]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/Signal.java
Add a new sync dbus message which shows messages you sent. Necessary for having synch...
[signal-cli] / src / main / java / org / asamk / Signal.java
index ab926d3fcbe02d7d33dba7c1da65f74a502b0575..f8b353c7bcac24d4f774c2a769e19d260909132b 100644 (file)
@@ -6,30 +6,41 @@ 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;
+    void sendMessage(String message, List<String> attachments, String recipient) throws EncapsulatedExceptions, AttachmentInvalidException, IOException, InvalidNumberException;
 
-    void sendEndSessionMessage(List<String> recipients) throws IOException, EncapsulatedExceptions;
+    void sendMessage(String message, List<String> attachments, List<String> recipients) throws EncapsulatedExceptions, AttachmentInvalidException, IOException, InvalidNumberException;
+
+    void sendEndSessionMessage(List<String> recipients) throws IOException, EncapsulatedExceptions, InvalidNumberException;
 
     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();
 
     String getGroupName(byte[] groupId);
 
     List<String> getGroupMembers(byte[] groupId);
 
-    byte[] updateGroup(byte[] groupId, String name, List<String> members, String avatar) throws IOException, EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException;
+    byte[] updateGroup(byte[] groupId, String name, List<String> members, String avatar) throws IOException, EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException, InvalidNumberException;
+
+    boolean isRegistered();
 
     class MessageReceived extends DBusSignal {
+
         private long timestamp;
         private String sender;
         private byte[] groupId;
@@ -67,6 +78,7 @@ public interface Signal extends DBusInterface {
     }
 
     class ReceiptReceived extends DBusSignal {
+
         private long timestamp;
         private String sender;
 
@@ -84,4 +96,47 @@ public interface Signal extends DBusInterface {
             return sender;
         }
     }
+
+    class SyncMessageReceived extends DBusSignal {
+        private long timestamp;
+        private String source;
+        private String destination;
+        private byte[] groupId;
+        private String message;
+        private List<String> attachments;
+
+        public SyncMessageReceived(String objectpath, long timestamp, String source, String destination, byte[] groupId, String message, List<String> attachments) throws DBusException {
+            super(objectpath, timestamp, source, destination, groupId, message, attachments);
+            this.timestamp = timestamp;
+            this.source = source;
+            this.destination = destination;
+            this.groupId = groupId;
+            this.message = message;
+            this.attachments = attachments;
+        }
+
+        public long getTimestamp() {
+            return timestamp;
+        }
+
+        public String getSource() {
+            return source;
+        }
+
+        public String getDestination() {
+            return destination;
+        }
+
+        public byte[] getGroupId() {
+            return groupId;
+        }
+
+        public String getMessage() {
+            return message;
+        }
+
+        public List<String> getAttachments() {
+            return attachments;
+        }
+    }
 }