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 class MessageReceived
extends DBusSignal
{
112 private final long timestamp
;
113 private final String sender
;
114 private final byte[] groupId
;
115 private final String message
;
116 private final List
<String
> attachments
;
118 public MessageReceived(
124 List
<String
> attachments
125 ) throws DBusException
{
126 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
127 this.timestamp
= timestamp
;
128 this.sender
= sender
;
129 this.groupId
= groupId
;
130 this.message
= message
;
131 this.attachments
= attachments
;
134 public long getTimestamp() {
138 public String
getSender() {
142 public byte[] getGroupId() {
146 public String
getMessage() {
150 public List
<String
> getAttachments() {
155 class ReceiptReceived
extends DBusSignal
{
157 private final long timestamp
;
158 private final String sender
;
160 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
161 super(objectpath
, timestamp
, sender
);
162 this.timestamp
= timestamp
;
163 this.sender
= sender
;
166 public long getTimestamp() {
170 public String
getSender() {
175 class SyncMessageReceived
extends DBusSignal
{
177 private final long timestamp
;
178 private final String source
;
179 private final String destination
;
180 private final byte[] groupId
;
181 private final String message
;
182 private final List
<String
> attachments
;
184 public SyncMessageReceived(
191 List
<String
> attachments
192 ) throws DBusException
{
193 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
194 this.timestamp
= timestamp
;
195 this.source
= source
;
196 this.destination
= destination
;
197 this.groupId
= groupId
;
198 this.message
= message
;
199 this.attachments
= attachments
;
202 public long getTimestamp() {
206 public String
getSource() {
210 public String
getDestination() {
214 public byte[] getGroupId() {
218 public String
getMessage() {
222 public List
<String
> getAttachments() {
229 class AttachmentInvalid
extends DBusExecutionException
{
231 public AttachmentInvalid(final String message
) {
236 class Failure
extends DBusExecutionException
{
238 public Failure(final String message
) {
243 class GroupNotFound
extends DBusExecutionException
{
245 public GroupNotFound(final String message
) {
250 class InvalidGroupId
extends DBusExecutionException
{
252 public InvalidGroupId(final String message
) {
257 class InvalidNumber
extends DBusExecutionException
{
259 public InvalidNumber(final String message
) {
264 class UntrustedIdentity
extends DBusExecutionException
{
266 public UntrustedIdentity(final String message
) {