]> nmode's Git Repositories - signal-cli/blob - src/main/java/org/asamk/Signal.java
Fix minor inspection issues
[signal-cli] / src / main / java / org / asamk / Signal.java
1 package org.asamk;
2
3 import org.asamk.signal.AttachmentInvalidException;
4 import org.asamk.signal.GroupNotFoundException;
5 import org.freedesktop.dbus.DBusInterface;
6 import org.freedesktop.dbus.DBusSignal;
7 import org.freedesktop.dbus.exceptions.DBusException;
8 import org.whispersystems.signalservice.api.push.exceptions.EncapsulatedExceptions;
9
10 import java.io.IOException;
11 import java.util.List;
12
13 public interface Signal extends DBusInterface {
14
15 void sendMessage(String message, List<String> attachments, String recipient) throws EncapsulatedExceptions, AttachmentInvalidException, IOException;
16
17 void sendMessage(String message, List<String> attachments, List<String> recipients) throws EncapsulatedExceptions, AttachmentInvalidException, IOException;
18
19 void sendEndSessionMessage(List<String> recipients) throws IOException, EncapsulatedExceptions;
20
21 void sendGroupMessage(String message, List<String> attachments, byte[] groupId) throws EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException, IOException;
22
23 String getContactName(String number);
24
25 void setContactName(String number, String name);
26
27 List<byte[]> getGroupIds();
28
29 String getGroupName(byte[] groupId);
30
31 List<String> getGroupMembers(byte[] groupId);
32
33 byte[] updateGroup(byte[] groupId, String name, List<String> members, String avatar) throws IOException, EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException;
34
35 class MessageReceived extends DBusSignal {
36
37 private long timestamp;
38 private String sender;
39 private byte[] groupId;
40 private String message;
41 private List<String> attachments;
42
43 public MessageReceived(String objectpath, long timestamp, String sender, byte[] groupId, String message, List<String> attachments) throws DBusException {
44 super(objectpath, timestamp, sender, groupId, message, attachments);
45 this.timestamp = timestamp;
46 this.sender = sender;
47 this.groupId = groupId;
48 this.message = message;
49 this.attachments = attachments;
50 }
51
52 public long getTimestamp() {
53 return timestamp;
54 }
55
56 public String getSender() {
57 return sender;
58 }
59
60 public byte[] getGroupId() {
61 return groupId;
62 }
63
64 public String getMessage() {
65 return message;
66 }
67
68 public List<String> getAttachments() {
69 return attachments;
70 }
71 }
72
73 class ReceiptReceived extends DBusSignal {
74
75 private long timestamp;
76 private String sender;
77
78 public ReceiptReceived(String objectpath, long timestamp, String sender) throws DBusException {
79 super(objectpath, timestamp, sender);
80 this.timestamp = timestamp;
81 this.sender = sender;
82 }
83
84 public long getTimestamp() {
85 return timestamp;
86 }
87
88 public String getSender() {
89 return sender;
90 }
91 }
92 }