mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
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:
parent
2ad18342a8
commit
05abb3f9f6
7 changed files with 184 additions and 3 deletions
|
@ -103,6 +103,45 @@ public class DbusSignalImpl implements Signal {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long sendRemoteDeleteMessage(
|
||||
final long targetSentTimestamp, final String recipient
|
||||
) {
|
||||
var recipients = new ArrayList<String>(1);
|
||||
recipients.add(recipient);
|
||||
return sendRemoteDeleteMessage(targetSentTimestamp, recipients);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long sendRemoteDeleteMessage(
|
||||
final long targetSentTimestamp, final List<String> recipients
|
||||
) {
|
||||
try {
|
||||
final var results = m.sendRemoteDeleteMessage(targetSentTimestamp, recipients);
|
||||
checkSendMessageResults(results.first(), results.second());
|
||||
return results.first();
|
||||
} catch (IOException e) {
|
||||
throw new Error.Failure(e.getMessage());
|
||||
} catch (InvalidNumberException e) {
|
||||
throw new Error.InvalidNumber(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long sendGroupRemoteDeleteMessage(
|
||||
final long targetSentTimestamp, final byte[] groupId
|
||||
) {
|
||||
try {
|
||||
final var results = m.sendGroupRemoteDeleteMessage(targetSentTimestamp, GroupId.unknownVersion(groupId));
|
||||
checkSendMessageResults(results.first(), results.second());
|
||||
return results.first();
|
||||
} catch (IOException e) {
|
||||
throw new Error.Failure(e.getMessage());
|
||||
} catch (GroupNotFoundException | NotAGroupMemberException e) {
|
||||
throw new Error.GroupNotFound(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long sendMessageReaction(
|
||||
final String emoji, final boolean remove, final String targetAuthor, final long targetSentTimestamp, final String recipient
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue