3 import org
.asamk
.signal
.manager
.AttachmentInvalidException
;
4 import org
.asamk
.signal
.manager
.GroupNotFoundException
;
5 import org
.freedesktop
.dbus
.exceptions
.DBusException
;
6 import org
.freedesktop
.dbus
.interfaces
.DBusInterface
;
7 import org
.freedesktop
.dbus
.messages
.DBusSignal
;
8 import org
.whispersystems
.signalservice
.api
.push
.exceptions
.EncapsulatedExceptions
;
9 import org
.whispersystems
.signalservice
.api
.util
.InvalidNumberException
;
11 import java
.io
.IOException
;
12 import java
.util
.List
;
14 public interface Signal
extends DBusInterface
{
16 long sendMessage(String message
, List
<String
> attachments
, String recipient
) throws EncapsulatedExceptions
, AttachmentInvalidException
, IOException
, InvalidNumberException
;
18 long sendMessage(String message
, List
<String
> attachments
, List
<String
> recipients
) throws EncapsulatedExceptions
, AttachmentInvalidException
, IOException
, InvalidNumberException
;
20 void sendEndSessionMessage(List
<String
> recipients
) throws IOException
, EncapsulatedExceptions
, InvalidNumberException
;
22 long sendGroupMessage(String message
, List
<String
> attachments
, byte[] groupId
) throws EncapsulatedExceptions
, GroupNotFoundException
, AttachmentInvalidException
, IOException
;
24 String
getContactName(String number
) throws InvalidNumberException
;
26 void setContactName(String number
, String name
) throws InvalidNumberException
;
28 void setContactBlocked(String number
, boolean blocked
) throws InvalidNumberException
;
30 void setGroupBlocked(byte[] groupId
, boolean blocked
) throws GroupNotFoundException
;
32 List
<byte[]> getGroupIds();
34 String
getGroupName(byte[] groupId
);
36 List
<String
> getGroupMembers(byte[] groupId
);
38 byte[] updateGroup(byte[] groupId
, String name
, List
<String
> members
, String avatar
) throws IOException
, EncapsulatedExceptions
, GroupNotFoundException
, AttachmentInvalidException
, InvalidNumberException
;
40 boolean isRegistered();
42 class MessageReceived
extends DBusSignal
{
44 private final long timestamp
;
45 private final String sender
;
46 private final byte[] groupId
;
47 private final String message
;
48 private final List
<String
> attachments
;
50 public MessageReceived(String objectpath
, long timestamp
, String sender
, byte[] groupId
, String message
, List
<String
> attachments
) throws DBusException
{
51 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
52 this.timestamp
= timestamp
;
54 this.groupId
= groupId
;
55 this.message
= message
;
56 this.attachments
= attachments
;
59 public long getTimestamp() {
63 public String
getSender() {
67 public byte[] getGroupId() {
71 public String
getMessage() {
75 public List
<String
> getAttachments() {
80 class ReceiptReceived
extends DBusSignal
{
82 private final long timestamp
;
83 private final String sender
;
85 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
86 super(objectpath
, timestamp
, sender
);
87 this.timestamp
= timestamp
;
91 public long getTimestamp() {
95 public String
getSender() {
100 class SyncMessageReceived
extends DBusSignal
{
102 private final long timestamp
;
103 private final String source
;
104 private final String destination
;
105 private final byte[] groupId
;
106 private final String message
;
107 private final List
<String
> attachments
;
109 public SyncMessageReceived(String objectpath
, long timestamp
, String source
, String destination
, byte[] groupId
, String message
, List
<String
> attachments
) throws DBusException
{
110 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
111 this.timestamp
= timestamp
;
112 this.source
= source
;
113 this.destination
= destination
;
114 this.groupId
= groupId
;
115 this.message
= message
;
116 this.attachments
= attachments
;
119 public long getTimestamp() {
123 public String
getSource() {
127 public String
getDestination() {
131 public byte[] getGroupId() {
135 public String
getMessage() {
139 public List
<String
> getAttachments() {