X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/af8a27e87f7844e733d1b42419c3976f0b41ae58..8b9640ba149c6ddc4dd9e7300c788a55303bc7b5:/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 02fc22dd..8c9c525f 100644 --- a/src/main/java/org/asamk/Signal.java +++ b/src/main/java/org/asamk/Signal.java @@ -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 attachments, String recipient) throws EncapsulatedExceptions, AttachmentInvalidException, IOException; void sendMessage(String message, List attachments, List recipients) throws EncapsulatedExceptions, AttachmentInvalidException, IOException; @@ -19,7 +21,26 @@ public interface Signal extends DBusInterface { void sendGroupMessage(String message, List 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 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; @@ -55,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; + } + } }