]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/Signal.java
Remove own number from group when quitting
[signal-cli] / src / main / java / org / asamk / Signal.java
index cb2025ab58ea2c9f1a9dc24a19f07d27b12e6296..e115bb7c0d03b8832c8971d8fa44548236a7fbac 100644 (file)
@@ -5,23 +5,55 @@ 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 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, String recipient) throws EncapsulatedExceptions, AttachmentInvalidException, IOException, UntrustedIdentityException;
 
-    void sendMessage(String message, List<String> attachments, List<String> recipients) throws EncapsulatedExceptions, AttachmentInvalidException, IOException;
+    void sendMessage(String message, List<String> attachments, List<String> recipients) throws EncapsulatedExceptions, AttachmentInvalidException, IOException, UntrustedIdentityException;
 
-    void sendEndSessionMessage(List<String> recipients) throws IOException, EncapsulatedExceptions;
+    void sendEndSessionMessage(List<String> recipients) throws IOException, EncapsulatedExceptions, UntrustedIdentityException;
 
-    void sendGroupMessage(String message, List<String> attachments, byte[] groupId) throws EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException, IOException;
+    void sendGroupMessage(String message, List<String> attachments, byte[] groupId) throws EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException, IOException, UntrustedIdentityException;
 
     class MessageReceived extends DBusSignal {
-        public MessageReceived(String objectpath, String sender, byte[] groupId, String message, List<String> attachments) throws DBusException {
-            super(objectpath, sender, groupId, message, attachments);
+        private long timestamp;
+        private String sender;
+        private byte[] groupId;
+        private String message;
+        private List<String> attachments;
+
+        public MessageReceived(String objectpath, long timestamp, String sender, byte[] groupId, String message, List<String> attachments) throws DBusException {
+            super(objectpath, timestamp, sender, groupId, message, attachments);
+            this.timestamp = timestamp;
+            this.sender = sender;
+            this.groupId = groupId;
+            this.message = message;
+            this.attachments = attachments;
+        }
+
+        public long getTimestamp() {
+            return timestamp;
+        }
+
+        public String getSender() {
+            return sender;
+        }
+
+        public byte[] getGroupId() {
+            return groupId;
+        }
+
+        public String getMessage() {
+            return message;
+        }
+
+        public List<String> getAttachments() {
+            return attachments;
         }
     }
 }