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 setExpirationTimer(final String number
, final int expiration
) throws Error
.Failure
;
76 void setContactBlocked(String number
, boolean blocked
) throws Error
.InvalidNumber
;
78 void setGroupBlocked(byte[] groupId
, boolean blocked
) throws Error
.GroupNotFound
, Error
.InvalidGroupId
;
80 List
<byte[]> getGroupIds();
82 String
getGroupName(byte[] groupId
) throws Error
.InvalidGroupId
;
84 List
<String
> getGroupMembers(byte[] groupId
) throws Error
.InvalidGroupId
;
87 byte[] groupId
, String name
, List
<String
> members
, String avatar
88 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.GroupNotFound
, Error
.InvalidGroupId
;
90 boolean isRegistered();
93 String name
, String about
, String aboutEmoji
, String avatarPath
, boolean removeAvatar
94 ) throws Error
.Failure
;
98 void setPin(String registrationLockPin
);
102 List
<String
> listNumbers();
104 List
<String
> getContactNumber(final String name
) throws Error
.Failure
;
106 void quitGroup(final byte[] groupId
) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidGroupId
;
108 boolean isContactBlocked(final String number
) throws Error
.InvalidNumber
;
110 boolean isGroupBlocked(final byte[] groupId
) throws Error
.InvalidGroupId
;
112 boolean isMember(final byte[] groupId
) throws Error
.InvalidGroupId
;
114 byte[] joinGroup(final String groupLink
) throws Error
.Failure
;
116 String
uploadStickerPack(String stickerPackPath
) throws Error
.Failure
;
118 class MessageReceived
extends DBusSignal
{
120 private final long timestamp
;
121 private final String sender
;
122 private final byte[] groupId
;
123 private final String message
;
124 private final List
<String
> attachments
;
126 public MessageReceived(
132 List
<String
> attachments
133 ) throws DBusException
{
134 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
135 this.timestamp
= timestamp
;
136 this.sender
= sender
;
137 this.groupId
= groupId
;
138 this.message
= message
;
139 this.attachments
= attachments
;
142 public long getTimestamp() {
146 public String
getSender() {
150 public byte[] getGroupId() {
154 public String
getMessage() {
158 public List
<String
> getAttachments() {
163 class ReceiptReceived
extends DBusSignal
{
165 private final long timestamp
;
166 private final String sender
;
168 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
169 super(objectpath
, timestamp
, sender
);
170 this.timestamp
= timestamp
;
171 this.sender
= sender
;
174 public long getTimestamp() {
178 public String
getSender() {
183 class SyncMessageReceived
extends DBusSignal
{
185 private final long timestamp
;
186 private final String source
;
187 private final String destination
;
188 private final byte[] groupId
;
189 private final String message
;
190 private final List
<String
> attachments
;
192 public SyncMessageReceived(
199 List
<String
> attachments
200 ) throws DBusException
{
201 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
202 this.timestamp
= timestamp
;
203 this.source
= source
;
204 this.destination
= destination
;
205 this.groupId
= groupId
;
206 this.message
= message
;
207 this.attachments
= attachments
;
210 public long getTimestamp() {
214 public String
getSource() {
218 public String
getDestination() {
222 public byte[] getGroupId() {
226 public String
getMessage() {
230 public List
<String
> getAttachments() {
237 class AttachmentInvalid
extends DBusExecutionException
{
239 public AttachmentInvalid(final String message
) {
244 class Failure
extends DBusExecutionException
{
246 public Failure(final String message
) {
251 class GroupNotFound
extends DBusExecutionException
{
253 public GroupNotFound(final String message
) {
258 class InvalidGroupId
extends DBusExecutionException
{
260 public InvalidGroupId(final String message
) {
265 class InvalidNumber
extends DBusExecutionException
{
267 public InvalidNumber(final String message
) {
272 class UntrustedIdentity
extends DBusExecutionException
{
274 public UntrustedIdentity(final String message
) {