package org.asamk; import org.asamk.signal.AttachmentInvalidException; 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.push.exceptions.EncapsulatedExceptions; import org.whispersystems.signalservice.api.util.InvalidNumberException; import java.io.IOException; import java.util.List; public interface Signal extends DBusInterface { long sendMessage(String message, List attachments, String recipient) throws EncapsulatedExceptions, AttachmentInvalidException, IOException, InvalidNumberException; long sendMessage(String message, List attachments, List recipients) throws EncapsulatedExceptions, AttachmentInvalidException, IOException, InvalidNumberException; void sendEndSessionMessage(List recipients) throws IOException, EncapsulatedExceptions, InvalidNumberException; long 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, InvalidNumberException; boolean isRegistered(); class MessageReceived extends DBusSignal { private long timestamp; private String sender; private byte[] groupId; private String message; private List attachments; public MessageReceived(String objectpath, long timestamp, String sender, byte[] groupId, String message, List 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 getAttachments() { 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; } } class SyncMessageReceived extends DBusSignal { private long timestamp; private String source; private String destination; private byte[] groupId; private String message; private List attachments; public SyncMessageReceived(String objectpath, long timestamp, String source, String destination, byte[] groupId, String message, List 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 getAttachments() { return attachments; } } }