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 long sendNoteToSelfMessage(
53 String message
, List
<String
> attachments
54 ) throws Error
.AttachmentInvalid
, Error
.Failure
;
56 void sendEndSessionMessage(List
<String
> recipients
) throws Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
58 long sendGroupMessage(
59 String message
, List
<String
> attachments
, byte[] groupId
60 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.AttachmentInvalid
, Error
.InvalidGroupId
;
62 long sendGroupMessageReaction(
63 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, byte[] groupId
64 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidNumber
, Error
.InvalidGroupId
;
66 String
getContactName(String number
) throws Error
.InvalidNumber
;
68 void setContactName(String number
, String name
) throws Error
.InvalidNumber
;
70 void setContactBlocked(String number
, boolean blocked
) throws Error
.InvalidNumber
;
72 void setGroupBlocked(byte[] groupId
, boolean blocked
) throws Error
.GroupNotFound
, Error
.InvalidGroupId
;
74 List
<byte[]> getGroupIds();
76 String
getGroupName(byte[] groupId
) throws Error
.InvalidGroupId
;
78 List
<String
> getGroupMembers(byte[] groupId
) throws Error
.InvalidGroupId
;
81 byte[] groupId
, String name
, List
<String
> members
, String avatar
82 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.GroupNotFound
, Error
.InvalidGroupId
;
84 boolean isRegistered();
87 String name
, String about
, String aboutEmoji
, String avatarPath
, boolean removeAvatar
88 ) throws Error
.Failure
;
92 void setPin(String registrationLockPin
);
96 List
<String
> listNumbers();
98 List
<String
> getContactNumber(final String name
) throws Error
.Failure
;
100 void quitGroup(final byte[] groupId
) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidGroupId
;
102 boolean isContactBlocked(final String number
) throws Error
.InvalidNumber
;
104 boolean isGroupBlocked(final byte[] groupId
) throws Error
.InvalidGroupId
;
106 boolean isMember(final byte[] groupId
) throws Error
.InvalidGroupId
;
108 byte[] joinGroup(final String groupLink
) throws Error
.Failure
;
110 String
uploadStickerPack(String stickerPackPath
) throws Error
.Failure
;
112 class MessageReceived
extends DBusSignal
{
114 private final long timestamp
;
115 private final String sender
;
116 private final byte[] groupId
;
117 private final String message
;
118 private final List
<String
> attachments
;
120 public MessageReceived(
126 List
<String
> attachments
127 ) throws DBusException
{
128 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
129 this.timestamp
= timestamp
;
130 this.sender
= sender
;
131 this.groupId
= groupId
;
132 this.message
= message
;
133 this.attachments
= attachments
;
136 public long getTimestamp() {
140 public String
getSender() {
144 public byte[] getGroupId() {
148 public String
getMessage() {
152 public List
<String
> getAttachments() {
157 class ReceiptReceived
extends DBusSignal
{
159 private final long timestamp
;
160 private final String sender
;
162 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
163 super(objectpath
, timestamp
, sender
);
164 this.timestamp
= timestamp
;
165 this.sender
= sender
;
168 public long getTimestamp() {
172 public String
getSender() {
177 class SyncMessageReceived
extends DBusSignal
{
179 private final long timestamp
;
180 private final String source
;
181 private final String destination
;
182 private final byte[] groupId
;
183 private final String message
;
184 private final List
<String
> attachments
;
186 public SyncMessageReceived(
193 List
<String
> attachments
194 ) throws DBusException
{
195 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
196 this.timestamp
= timestamp
;
197 this.source
= source
;
198 this.destination
= destination
;
199 this.groupId
= groupId
;
200 this.message
= message
;
201 this.attachments
= attachments
;
204 public long getTimestamp() {
208 public String
getSource() {
212 public String
getDestination() {
216 public byte[] getGroupId() {
220 public String
getMessage() {
224 public List
<String
> getAttachments() {
231 class AttachmentInvalid
extends DBusExecutionException
{
233 public AttachmentInvalid(final String message
) {
238 class Failure
extends DBusExecutionException
{
240 public Failure(final String message
) {
245 class GroupNotFound
extends DBusExecutionException
{
247 public GroupNotFound(final String message
) {
252 class InvalidGroupId
extends DBusExecutionException
{
254 public InvalidGroupId(final String message
) {
259 class InvalidNumber
extends DBusExecutionException
{
261 public InvalidNumber(final String message
) {
266 class UntrustedIdentity
extends DBusExecutionException
{
268 public UntrustedIdentity(final String message
) {