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
{
16 String
getSelfNumber();
19 String message
, List
<String
> attachments
, String recipient
20 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
23 String message
, List
<String
> attachments
, List
<String
> recipients
24 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
27 String recipient
, boolean stop
28 ) throws Error
.Failure
, Error
.GroupNotFound
, Error
.UntrustedIdentity
;
31 String recipient
, List
<Long
> messageIds
32 ) throws Error
.Failure
, Error
.UntrustedIdentity
;
34 long sendRemoteDeleteMessage(
35 long targetSentTimestamp
, String recipient
36 ) throws Error
.Failure
, Error
.InvalidNumber
;
38 long sendRemoteDeleteMessage(
39 long targetSentTimestamp
, List
<String
> recipients
40 ) throws Error
.Failure
, Error
.InvalidNumber
;
42 long sendGroupRemoteDeleteMessage(
43 long targetSentTimestamp
, byte[] groupId
44 ) throws Error
.Failure
, Error
.GroupNotFound
, Error
.InvalidGroupId
;
46 long sendMessageReaction(
47 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, String recipient
48 ) throws Error
.InvalidNumber
, Error
.Failure
;
50 long sendMessageReaction(
51 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, List
<String
> recipients
52 ) throws Error
.InvalidNumber
, Error
.Failure
;
54 void sendContacts() throws Error
.Failure
;
56 void sendSyncRequest() throws Error
.Failure
;
58 long sendNoteToSelfMessage(
59 String message
, List
<String
> attachments
60 ) throws Error
.AttachmentInvalid
, Error
.Failure
;
62 void sendEndSessionMessage(List
<String
> recipients
) throws Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
64 long sendGroupMessage(
65 String message
, List
<String
> attachments
, byte[] groupId
66 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.AttachmentInvalid
, Error
.InvalidGroupId
;
68 long sendGroupMessageReaction(
69 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, byte[] groupId
70 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidNumber
, Error
.InvalidGroupId
;
72 String
getContactName(String number
) throws Error
.InvalidNumber
;
74 void setContactName(String number
, String name
) throws Error
.InvalidNumber
;
76 void setExpirationTimer(final String number
, final int expiration
) throws Error
.Failure
;
78 void setContactBlocked(String number
, boolean blocked
) throws Error
.InvalidNumber
;
80 void setGroupBlocked(byte[] groupId
, boolean blocked
) throws Error
.GroupNotFound
, Error
.InvalidGroupId
;
82 List
<byte[]> getGroupIds();
84 String
getGroupName(byte[] groupId
) throws Error
.InvalidGroupId
;
86 List
<String
> getGroupMembers(byte[] groupId
) throws Error
.InvalidGroupId
;
89 byte[] groupId
, String name
, List
<String
> members
, String avatar
90 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.GroupNotFound
, Error
.InvalidGroupId
;
92 boolean isRegistered() throws Error
.Failure
, Error
.InvalidNumber
;
94 boolean isRegistered(String number
) throws Error
.Failure
, Error
.InvalidNumber
;
96 List
<Boolean
> isRegistered(List
<String
> numbers
) throws Error
.Failure
, Error
.InvalidNumber
;
98 void addDevice(String uri
) throws Error
.InvalidUri
;
100 void removeDevice(int deviceId
) throws Error
.Failure
;
102 List
<String
> listDevices() throws Error
.Failure
;
104 void updateDeviceName(String deviceName
) throws Error
.Failure
;
113 ) throws Error
.Failure
;
116 String name
, String about
, String aboutEmoji
, String avatarPath
, boolean removeAvatar
117 ) throws Error
.Failure
;
121 void setPin(String registrationLockPin
);
125 List
<String
> listNumbers();
127 List
<String
> getContactNumber(final String name
) throws Error
.Failure
;
129 void quitGroup(final byte[] groupId
) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidGroupId
;
131 boolean isContactBlocked(final String number
) throws Error
.InvalidNumber
;
133 boolean isGroupBlocked(final byte[] groupId
) throws Error
.InvalidGroupId
;
135 boolean isMember(final byte[] groupId
) throws Error
.InvalidGroupId
;
137 byte[] joinGroup(final String groupLink
) throws Error
.Failure
;
139 String
uploadStickerPack(String stickerPackPath
) throws Error
.Failure
;
141 class MessageReceived
extends DBusSignal
{
143 private final long timestamp
;
144 private final String sender
;
145 private final byte[] groupId
;
146 private final String message
;
147 private final List
<String
> attachments
;
149 public MessageReceived(
155 List
<String
> attachments
156 ) throws DBusException
{
157 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
158 this.timestamp
= timestamp
;
159 this.sender
= sender
;
160 this.groupId
= groupId
;
161 this.message
= message
;
162 this.attachments
= attachments
;
165 public long getTimestamp() {
169 public String
getSender() {
173 public byte[] getGroupId() {
177 public String
getMessage() {
181 public List
<String
> getAttachments() {
186 class ReceiptReceived
extends DBusSignal
{
188 private final long timestamp
;
189 private final String sender
;
191 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
192 super(objectpath
, timestamp
, sender
);
193 this.timestamp
= timestamp
;
194 this.sender
= sender
;
197 public long getTimestamp() {
201 public String
getSender() {
206 class SyncMessageReceived
extends DBusSignal
{
208 private final long timestamp
;
209 private final String source
;
210 private final String destination
;
211 private final byte[] groupId
;
212 private final String message
;
213 private final List
<String
> attachments
;
215 public SyncMessageReceived(
222 List
<String
> attachments
223 ) throws DBusException
{
224 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
225 this.timestamp
= timestamp
;
226 this.source
= source
;
227 this.destination
= destination
;
228 this.groupId
= groupId
;
229 this.message
= message
;
230 this.attachments
= attachments
;
233 public long getTimestamp() {
237 public String
getSource() {
241 public String
getDestination() {
245 public byte[] getGroupId() {
249 public String
getMessage() {
253 public List
<String
> getAttachments() {
260 class AttachmentInvalid
extends DBusExecutionException
{
262 public AttachmentInvalid(final String message
) {
267 class InvalidUri
extends DBusExecutionException
{
269 public InvalidUri(final String message
) {
274 class Failure
extends DBusExecutionException
{
276 public Failure(final String message
) {
281 class GroupNotFound
extends DBusExecutionException
{
283 public GroupNotFound(final String message
) {
288 class InvalidGroupId
extends DBusExecutionException
{
290 public InvalidGroupId(final String message
) {
295 class InvalidNumber
extends DBusExecutionException
{
297 public InvalidNumber(final String message
) {
302 class UntrustedIdentity
extends DBusExecutionException
{
304 public UntrustedIdentity(final String message
) {