]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/Signal.java
Remove ThreadStore and store message expiration time in group/contact store
[signal-cli] / src / main / java / org / asamk / Signal.java
index 9a868109387d91c6bf0a0cbd7a124aaf6e953e0c..528116b11f108d159ddd289e6c200169b9294990 100644 (file)
@@ -5,22 +5,42 @@ import org.asamk.signal.GroupNotFoundException;
 import org.freedesktop.dbus.DBusInterface;
 import org.freedesktop.dbus.DBusSignal;
 import org.freedesktop.dbus.exceptions.DBusException;
-import org.whispersystems.signalservice.api.crypto.UntrustedIdentityException;
 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) throws InvalidNumberException;
+
+    void setContactName(String number, String name) throws InvalidNumberException;
+
+    void setContactBlocked(String number, boolean blocked) throws InvalidNumberException;
+
+    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, InvalidNumberException;
+
+    boolean isRegistered();
+
     class MessageReceived extends DBusSignal {
+
         private long timestamp;
         private String sender;
         private byte[] groupId;
@@ -56,4 +76,24 @@ public interface Signal extends DBusInterface {
             return attachments;
         }
     }
+
+    class ReceiptReceived extends DBusSignal {
+
+        private long timestamp;
+        private String sender;
+
+        public ReceiptReceived(String objectpath, long timestamp, String sender) throws DBusException {
+            super(objectpath, timestamp, sender);
+            this.timestamp = timestamp;
+            this.sender = sender;
+        }
+
+        public long getTimestamp() {
+            return timestamp;
+        }
+
+        public String getSender() {
+            return sender;
+        }
+    }
 }