mirror of
https://github.com/aljazceru/signal-cli.git
synced 2025-12-19 07:04:21 +01:00
Use var instead of explicit types
This commit is contained in:
@@ -4,7 +4,6 @@ import net.sourceforge.argparse4j.inf.Namespace;
|
||||
import net.sourceforge.argparse4j.inf.Subparser;
|
||||
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.groups.GroupId;
|
||||
import org.asamk.signal.manager.groups.GroupIdFormatException;
|
||||
import org.asamk.signal.manager.groups.GroupNotFoundException;
|
||||
import org.asamk.signal.util.Util;
|
||||
@@ -21,7 +20,7 @@ public class BlockCommand implements LocalCommand {
|
||||
|
||||
@Override
|
||||
public int handleCommand(final Namespace ns, final Manager m) {
|
||||
for (String contact_number : ns.<String>getList("contact")) {
|
||||
for (var contact_number : ns.<String>getList("contact")) {
|
||||
try {
|
||||
m.setContactBlocked(contact_number, true);
|
||||
} catch (InvalidNumberException e) {
|
||||
@@ -30,9 +29,9 @@ public class BlockCommand implements LocalCommand {
|
||||
}
|
||||
|
||||
if (ns.<String>getList("group") != null) {
|
||||
for (String groupIdString : ns.<String>getList("group")) {
|
||||
for (var groupIdString : ns.<String>getList("group")) {
|
||||
try {
|
||||
GroupId groupId = Util.decodeGroupId(groupIdString);
|
||||
var groupId = Util.decodeGroupId(groupIdString);
|
||||
m.setGroupBlocked(groupId, true);
|
||||
} catch (GroupIdFormatException | GroupNotFoundException e) {
|
||||
System.err.println(e.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user