Send remote delete (#593)

* Implementation of remoteDelete command, iteration 1

* Implementation of remoteDelete command, iteration 2

* Implementation of remoteDelete command, iteration 3

* Implementation of remoteDelete command, iteration 4

* Implementation of remoteDelete command, iteration 5

* Implementation of remoteDelete command, iteration 6

* Renaming dbus methods remoteGroupDelete -> sendGroupRemoteDeleteMessage, remoteDelete -> sendRemoteDeleteMessage
This commit is contained in:
Adaptive Garage 2021-04-05 19:49:45 +02:00 committed by GitHub
parent 2ad18342a8
commit 05abb3f9f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 184 additions and 3 deletions

View file

@ -992,6 +992,22 @@ public class Manager implements Closeable {
return sendSelfMessage(messageBuilder);
}
public Pair<Long, List<SendMessageResult>> sendRemoteDeleteMessage(
long targetSentTimestamp, List<String> recipients
) throws IOException, InvalidNumberException {
var delete = new SignalServiceDataMessage.RemoteDelete(targetSentTimestamp);
final var messageBuilder = SignalServiceDataMessage.newBuilder().withRemoteDelete(delete);
return sendMessage(messageBuilder, getSignalServiceAddresses(recipients));
}
public Pair<Long, List<SendMessageResult>> sendGroupRemoteDeleteMessage(
long targetSentTimestamp, GroupId groupId
) throws IOException, NotAGroupMemberException, GroupNotFoundException {
var delete = new SignalServiceDataMessage.RemoteDelete(targetSentTimestamp);
final var messageBuilder = SignalServiceDataMessage.newBuilder().withRemoteDelete(delete);
return sendGroupMessage(messageBuilder, groupId);
}
public Pair<Long, List<SendMessageResult>> sendMessageReaction(
String emoji, boolean remove, String targetAuthor, long targetSentTimestamp, List<String> recipients
) throws IOException, InvalidNumberException {