]>
nmode's Git Repositories - signal-cli/blob - src/main/java/org/asamk/Signal.java
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
;
24 long sendMessageReaction(
25 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, String recipient
26 ) throws Error
.InvalidNumber
, Error
.Failure
;
28 long sendMessageReaction(
29 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, List
<String
> recipients
30 ) throws Error
.InvalidNumber
, Error
.Failure
;
32 long sendNoteToSelfMessage(
33 String message
, List
<String
> attachments
34 ) throws Error
.AttachmentInvalid
, Error
.Failure
;
36 void sendEndSessionMessage(List
<String
> recipients
) throws Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
38 long sendGroupMessage(
39 String message
, List
<String
> attachments
, byte[] groupId
40 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.AttachmentInvalid
;
42 long sendGroupMessageReaction(
43 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, byte[] groupId
44 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidNumber
;
46 String
getContactName(String number
) throws Error
.InvalidNumber
;
48 void setContactName(String number
, String name
) throws Error
.InvalidNumber
;
50 void setContactBlocked(String number
, boolean blocked
) throws Error
.InvalidNumber
;
52 void setGroupBlocked(byte[] groupId
, boolean blocked
) throws Error
.GroupNotFound
;
54 List
<byte[]> getGroupIds();
56 String
getGroupName(byte[] groupId
);
58 List
<String
> getGroupMembers(byte[] groupId
);
61 byte[] groupId
, String name
, List
<String
> members
, String avatar
62 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.GroupNotFound
;
64 boolean isRegistered();
67 String name
, String about
, String aboutEmoji
, String avatarPath
, boolean removeAvatar
68 ) throws Error
.Failure
;
72 List
<String
> listNumbers();
74 List
<String
> getContactNumber(final String name
) throws Error
.Failure
;
76 void quitGroup(final byte[] groupId
) throws Error
.GroupNotFound
, Error
.Failure
;
78 boolean isContactBlocked(final String number
);
80 boolean isGroupBlocked(final byte[] groupId
);
82 boolean isMember(final byte[] groupId
);
84 void joinGroup(final String groupLink
) throws Error
.Failure
;
86 class MessageReceived
extends DBusSignal
{
88 private final long timestamp
;
89 private final String sender
;
90 private final byte[] groupId
;
91 private final String message
;
92 private final List
<String
> attachments
;
94 public MessageReceived(
100 List
<String
> attachments
101 ) throws DBusException
{
102 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
103 this.timestamp
= timestamp
;
104 this.sender
= sender
;
105 this.groupId
= groupId
;
106 this.message
= message
;
107 this.attachments
= attachments
;
110 public long getTimestamp() {
114 public String
getSender() {
118 public byte[] getGroupId() {
122 public String
getMessage() {
126 public List
<String
> getAttachments() {
131 class ReceiptReceived
extends DBusSignal
{
133 private final long timestamp
;
134 private final String sender
;
136 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
137 super(objectpath
, timestamp
, sender
);
138 this.timestamp
= timestamp
;
139 this.sender
= sender
;
142 public long getTimestamp() {
146 public String
getSender() {
151 class SyncMessageReceived
extends DBusSignal
{
153 private final long timestamp
;
154 private final String source
;
155 private final String destination
;
156 private final byte[] groupId
;
157 private final String message
;
158 private final List
<String
> attachments
;
160 public SyncMessageReceived(
167 List
<String
> attachments
168 ) throws DBusException
{
169 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
170 this.timestamp
= timestamp
;
171 this.source
= source
;
172 this.destination
= destination
;
173 this.groupId
= groupId
;
174 this.message
= message
;
175 this.attachments
= attachments
;
178 public long getTimestamp() {
182 public String
getSource() {
186 public String
getDestination() {
190 public byte[] getGroupId() {
194 public String
getMessage() {
198 public List
<String
> getAttachments() {
205 class AttachmentInvalid
extends DBusExecutionException
{
207 public AttachmentInvalid(final String message
) {
212 class Failure
extends DBusExecutionException
{
214 public Failure(final String message
) {
219 class GroupNotFound
extends DBusExecutionException
{
221 public GroupNotFound(final String message
) {
226 class InvalidNumber
extends DBusExecutionException
{
228 public InvalidNumber(final String message
) {
233 class UntrustedIdentity
extends DBusExecutionException
{
235 public UntrustedIdentity(final String message
) {