]> nmode's Git Repositories - signal-cli/blob - src/main/java/org/asamk/Signal.java
Prevent sending to groups that the user has quit
[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 void sendMessage(String message, List<String> attachments, String recipient) throws EncapsulatedExceptions, AttachmentInvalidException, IOException;
15
16 void sendMessage(String message, List<String> attachments, List<String> recipients) throws EncapsulatedExceptions, AttachmentInvalidException, IOException;
17
18 void sendEndSessionMessage(List<String> recipients) throws IOException, EncapsulatedExceptions;
19
20 void sendGroupMessage(String message, List<String> attachments, byte[] groupId) throws EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException, IOException;
21
22 class MessageReceived extends DBusSignal {
23 private long timestamp;
24 private String sender;
25 private byte[] groupId;
26 private String message;
27 private List<String> attachments;
28
29 public MessageReceived(String objectpath, long timestamp, String sender, byte[] groupId, String message, List<String> attachments) throws DBusException {
30 super(objectpath, timestamp, sender, groupId, message, attachments);
31 this.timestamp = timestamp;
32 this.sender = sender;
33 this.groupId = groupId;
34 this.message = message;
35 this.attachments = attachments;
36 }
37
38 public long getTimestamp() {
39 return timestamp;
40 }
41
42 public String getSender() {
43 return sender;
44 }
45
46 public byte[] getGroupId() {
47 return groupId;
48 }
49
50 public String getMessage() {
51 return message;
52 }
53
54 public List<String> getAttachments() {
55 return attachments;
56 }
57 }
58 }