3 import org
.freedesktop
.dbus
.exceptions
.DBusException
;
4 import org
.freedesktop
.dbus
.exceptions
.DBusExecutionException
;
5 import org
.freedesktop
.dbus
.interfaces
.DBusInterface
;
6 import org
.freedesktop
.dbus
.messages
.DBusSignal
;
11 * DBus interface for the org.asamk.Signal service.
12 * Including emitted Signals and returned Errors.
14 public interface Signal
extends DBusInterface
{
17 String message
, List
<String
> attachments
, String recipient
18 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
21 String message
, List
<String
> attachments
, List
<String
> recipients
22 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
25 String recipient
, boolean stop
26 ) throws Error
.Failure
, Error
.GroupNotFound
, Error
.UntrustedIdentity
;
29 String recipient
, List
<Long
> targetSentTimestamp
30 ) throws Error
.Failure
, Error
.UntrustedIdentity
;
32 long sendRemoteDeleteMessage(
33 long targetSentTimestamp
, String recipient
34 ) throws Error
.Failure
, Error
.InvalidNumber
;
36 long sendRemoteDeleteMessage(
37 long targetSentTimestamp
, List
<String
> recipients
38 ) throws Error
.Failure
, Error
.InvalidNumber
;
40 long sendGroupRemoteDeleteMessage(
41 long targetSentTimestamp
, byte[] groupId
42 ) throws Error
.Failure
, Error
.GroupNotFound
, Error
.InvalidGroupId
;
44 long sendMessageReaction(
45 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, String recipient
46 ) throws Error
.InvalidNumber
, Error
.Failure
;
48 long sendMessageReaction(
49 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, List
<String
> recipients
50 ) throws Error
.InvalidNumber
, Error
.Failure
;
52 void sendContacts() throws Error
.Failure
;
54 void sendSyncRequest() throws Error
.Failure
;
56 long sendNoteToSelfMessage(
57 String message
, List
<String
> attachments
58 ) throws Error
.AttachmentInvalid
, Error
.Failure
;
60 void sendEndSessionMessage(List
<String
> recipients
) throws Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
62 long sendGroupMessage(
63 String message
, List
<String
> attachments
, byte[] groupId
64 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.AttachmentInvalid
, Error
.InvalidGroupId
;
66 long sendGroupMessageReaction(
67 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, byte[] groupId
68 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidNumber
, Error
.InvalidGroupId
;
70 String
getContactName(String number
) throws Error
.InvalidNumber
;
72 void setContactName(String number
, String name
) throws Error
.InvalidNumber
;
74 void setContactBlocked(String number
, boolean blocked
) throws Error
.InvalidNumber
;
76 void setGroupBlocked(byte[] groupId
, boolean blocked
) throws Error
.GroupNotFound
, Error
.InvalidGroupId
;
78 List
<byte[]> getGroupIds();
80 String
getGroupName(byte[] groupId
) throws Error
.InvalidGroupId
;
82 List
<String
> getGroupMembers(byte[] groupId
) throws Error
.InvalidGroupId
;
85 byte[] groupId
, String name
, List
<String
> members
, String avatar
86 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.GroupNotFound
, Error
.InvalidGroupId
;
88 boolean isRegistered();
91 String name
, String about
, String aboutEmoji
, String avatarPath
, boolean removeAvatar
92 ) throws Error
.Failure
;
96 void setPin(String registrationLockPin
);
100 List
<String
> listNumbers();
102 List
<String
> getContactNumber(final String name
) throws Error
.Failure
;
104 void quitGroup(final byte[] groupId
) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidGroupId
;
106 boolean isContactBlocked(final String number
) throws Error
.InvalidNumber
;
108 boolean isGroupBlocked(final byte[] groupId
) throws Error
.InvalidGroupId
;
110 boolean isMember(final byte[] groupId
) throws Error
.InvalidGroupId
;
112 byte[] joinGroup(final String groupLink
) throws Error
.Failure
;
114 String
uploadStickerPack(String stickerPackPath
) throws Error
.Failure
;
116 class MessageReceived
extends DBusSignal
{
118 private final long timestamp
;
119 private final String sender
;
120 private final byte[] groupId
;
121 private final String message
;
122 private final List
<String
> attachments
;
124 public MessageReceived(
130 List
<String
> attachments
131 ) throws DBusException
{
132 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
133 this.timestamp
= timestamp
;
134 this.sender
= sender
;
135 this.groupId
= groupId
;
136 this.message
= message
;
137 this.attachments
= attachments
;
140 public long getTimestamp() {
144 public String
getSender() {
148 public byte[] getGroupId() {
152 public String
getMessage() {
156 public List
<String
> getAttachments() {
161 class ReceiptReceived
extends DBusSignal
{
163 private final long timestamp
;
164 private final String sender
;
166 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
167 super(objectpath
, timestamp
, sender
);
168 this.timestamp
= timestamp
;
169 this.sender
= sender
;
172 public long getTimestamp() {
176 public String
getSender() {
181 class SyncMessageReceived
extends DBusSignal
{
183 private final long timestamp
;
184 private final String source
;
185 private final String destination
;
186 private final byte[] groupId
;
187 private final String message
;
188 private final List
<String
> attachments
;
190 public SyncMessageReceived(
197 List
<String
> attachments
198 ) throws DBusException
{
199 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
200 this.timestamp
= timestamp
;
201 this.source
= source
;
202 this.destination
= destination
;
203 this.groupId
= groupId
;
204 this.message
= message
;
205 this.attachments
= attachments
;
208 public long getTimestamp() {
212 public String
getSource() {
216 public String
getDestination() {
220 public byte[] getGroupId() {
224 public String
getMessage() {
228 public List
<String
> getAttachments() {
235 class AttachmentInvalid
extends DBusExecutionException
{
237 public AttachmentInvalid(final String message
) {
242 class Failure
extends DBusExecutionException
{
244 public Failure(final String message
) {
249 class GroupNotFound
extends DBusExecutionException
{
251 public GroupNotFound(final String message
) {
256 class InvalidGroupId
extends DBusExecutionException
{
258 public InvalidGroupId(final String message
) {
263 class InvalidNumber
extends DBusExecutionException
{
265 public InvalidNumber(final String message
) {
270 class UntrustedIdentity
extends DBusExecutionException
{
272 public UntrustedIdentity(final String message
) {