]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/Signal.java
Add support for blocking contacts and accounts (#260)
[signal-cli] / src / main / java / org / asamk / Signal.java
index 88b15926b485956933a598ddb23478fda9b19769..8c9c525ff21a0755a5fa06bd7039367ca448c26b 100644 (file)
@@ -6,11 +6,13 @@ import org.freedesktop.dbus.DBusInterface;
 import org.freedesktop.dbus.DBusSignal;
 import org.freedesktop.dbus.exceptions.DBusException;
 import org.whispersystems.signalservice.api.push.exceptions.EncapsulatedExceptions;
+import org.whispersystems.signalservice.api.util.InvalidNumberException;
 
 import java.io.IOException;
 import java.util.List;
 
 public interface Signal extends DBusInterface {
+
     void sendMessage(String message, List<String> attachments, String recipient) throws EncapsulatedExceptions, AttachmentInvalidException, IOException;
 
     void sendMessage(String message, List<String> attachments, List<String> recipients) throws EncapsulatedExceptions, AttachmentInvalidException, IOException;
@@ -19,9 +21,13 @@ public interface Signal extends DBusInterface {
 
     void sendGroupMessage(String message, List<String> attachments, byte[] groupId) throws EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException, IOException;
 
-    String getContactName(String number);
+    String getContactName(String number) throws InvalidNumberException;
+
+    void setContactName(String number, String name) throws InvalidNumberException;
+
+    void setContactBlocked(String number, boolean blocked) throws InvalidNumberException;
 
-    void setContactName(String number, String name);
+    void setGroupBlocked(byte[] groupId, boolean blocked) throws GroupNotFoundException;
 
     List<byte[]> getGroupIds();
 
@@ -31,7 +37,10 @@ public interface Signal extends DBusInterface {
 
     byte[] updateGroup(byte[] groupId, String name, List<String> members, String avatar) throws IOException, EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException;
 
+    boolean isRegistered();
+
     class MessageReceived extends DBusSignal {
+
         private long timestamp;
         private String sender;
         private byte[] groupId;
@@ -69,6 +78,7 @@ public interface Signal extends DBusInterface {
     }
 
     class ReceiptReceived extends DBusSignal {
+
         private long timestamp;
         private String sender;