]> nmode's Git Repositories - signal-cli/blob - src/main/java/org/asamk/Signal.java
Store group member uuids in group store
[signal-cli] / src / main / java / org / asamk / Signal.java
1 package org.asamk;
2
3 import org.asamk.signal.AttachmentInvalidException;
4 import org.asamk.signal.GroupNotFoundException;
5 import org.freedesktop.dbus.DBusInterface;
6 import org.freedesktop.dbus.DBusSignal;
7 import org.freedesktop.dbus.exceptions.DBusException;
8 import org.whispersystems.signalservice.api.push.exceptions.EncapsulatedExceptions;
9 import org.whispersystems.signalservice.api.util.InvalidNumberException;
10
11 import java.io.IOException;
12 import java.util.List;
13
14 public interface Signal extends DBusInterface {
15
16 void sendMessage(String message, List<String> attachments, String recipient) throws EncapsulatedExceptions, AttachmentInvalidException, IOException, InvalidNumberException;
17
18 void sendMessage(String message, List<String> attachments, List<String> recipients) throws EncapsulatedExceptions, AttachmentInvalidException, IOException, InvalidNumberException;
19
20 void sendEndSessionMessage(List<String> recipients) throws IOException, EncapsulatedExceptions, InvalidNumberException;
21
22 void sendGroupMessage(String message, List<String> attachments, byte[] groupId) throws EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException, IOException;
23
24 String getContactName(String number) throws InvalidNumberException;
25
26 void setContactName(String number, String name) throws InvalidNumberException;
27
28 void setContactBlocked(String number, boolean blocked) throws InvalidNumberException;
29
30 void setGroupBlocked(byte[] groupId, boolean blocked) throws GroupNotFoundException;
31
32 List<byte[]> getGroupIds();
33
34 String getGroupName(byte[] groupId);
35
36 List<String> getGroupMembers(byte[] groupId);
37
38 byte[] updateGroup(byte[] groupId, String name, List<String> members, String avatar) throws IOException, EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException, InvalidNumberException;
39
40 boolean isRegistered();
41
42 class MessageReceived extends DBusSignal {
43
44 private long timestamp;
45 private String sender;
46 private byte[] groupId;
47 private String message;
48 private List<String> attachments;
49
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;
53 this.sender = sender;
54 this.groupId = groupId;
55 this.message = message;
56 this.attachments = attachments;
57 }
58
59 public long getTimestamp() {
60 return timestamp;
61 }
62
63 public String getSender() {
64 return sender;
65 }
66
67 public byte[] getGroupId() {
68 return groupId;
69 }
70
71 public String getMessage() {
72 return message;
73 }
74
75 public List<String> getAttachments() {
76 return attachments;
77 }
78 }
79
80 class ReceiptReceived extends DBusSignal {
81
82 private long timestamp;
83 private String sender;
84
85 public ReceiptReceived(String objectpath, long timestamp, String sender) throws DBusException {
86 super(objectpath, timestamp, sender);
87 this.timestamp = timestamp;
88 this.sender = sender;
89 }
90
91 public long getTimestamp() {
92 return timestamp;
93 }
94
95 public String getSender() {
96 return sender;
97 }
98 }
99 }