X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/5c117bd863c6b01e21b2865ebffd04c5cb23003c..7e897fa6d0aaa87646b51efa3ee1a5ecfaa3865e:/src/main/java/org/asamk/Signal.java diff --git a/src/main/java/org/asamk/Signal.java b/src/main/java/org/asamk/Signal.java index e115bb7c..6fb59303 100644 --- a/src/main/java/org/asamk/Signal.java +++ b/src/main/java/org/asamk/Signal.java @@ -5,22 +5,37 @@ 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 attachments, String recipient) throws EncapsulatedExceptions, AttachmentInvalidException, IOException, UntrustedIdentityException; - void sendMessage(String message, List attachments, List recipients) throws EncapsulatedExceptions, AttachmentInvalidException, IOException, UntrustedIdentityException; + void sendMessage(String message, List attachments, String recipient) throws EncapsulatedExceptions, AttachmentInvalidException, IOException; - void sendEndSessionMessage(List recipients) throws IOException, EncapsulatedExceptions, UntrustedIdentityException; + void sendMessage(String message, List attachments, List recipients) throws EncapsulatedExceptions, AttachmentInvalidException, IOException; - void sendGroupMessage(String message, List attachments, byte[] groupId) throws EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException, IOException, UntrustedIdentityException; + void sendEndSessionMessage(List recipients) throws IOException, EncapsulatedExceptions; + + void sendGroupMessage(String message, List attachments, byte[] groupId) throws EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException, IOException; + + String getContactName(String number); + + void setContactName(String number, String name); + + List getGroupIds(); + + String getGroupName(byte[] groupId); + + List getGroupMembers(byte[] groupId); + + byte[] updateGroup(byte[] groupId, String name, List members, String avatar) throws IOException, EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException; + + boolean isRegistered(); class MessageReceived extends DBusSignal { + private long timestamp; private String sender; private byte[] groupId; @@ -56,4 +71,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; + } + } }