mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Implement reacting to stories
This commit is contained in:
parent
207764e0be
commit
fea19c9e20
9 changed files with 33 additions and 10 deletions
|
@ -45,6 +45,9 @@ public class SendReactionCommand implements JsonRpcLocalCommand {
|
|||
.type(long.class)
|
||||
.help("Specify the timestamp of the message to which to react.");
|
||||
subparser.addArgument("-r", "--remove").help("Remove a reaction.").action(Arguments.storeTrue());
|
||||
subparser.addArgument("--story")
|
||||
.help("React to a story instead of a normal message")
|
||||
.action(Arguments.storeTrue());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -64,13 +67,15 @@ public class SendReactionCommand implements JsonRpcLocalCommand {
|
|||
final var isRemove = Boolean.TRUE.equals(ns.getBoolean("remove"));
|
||||
final var targetAuthor = ns.getString("target-author");
|
||||
final var targetTimestamp = ns.getLong("target-timestamp");
|
||||
final var isStory = Boolean.TRUE.equals(ns.getBoolean("story"));
|
||||
|
||||
try {
|
||||
final var results = m.sendMessageReaction(emoji,
|
||||
isRemove,
|
||||
CommandUtil.getSingleRecipientIdentifier(targetAuthor, m.getSelfNumber()),
|
||||
targetTimestamp,
|
||||
recipientIdentifiers);
|
||||
recipientIdentifiers,
|
||||
isStory);
|
||||
outputResult(outputWriter, results);
|
||||
} catch (GroupNotFoundException | NotAGroupMemberException | GroupSendingNotAllowedException e) {
|
||||
throw new UserErrorException(e.getMessage());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue