#[arg(short = 'r', long)]
remove: bool,
+
+ #[arg(long)]
+ story: bool,
},
SendReceipt {
recipient: String,
#[allow(non_snake_case)] targetAuthor: String,
#[allow(non_snake_case)] targetTimestamp: u64,
remove: bool,
+ story: bool,
) -> Result<Value>;
#[rpc(name = "sendReceipt", params = "named")]
target_author,
target_timestamp,
remove,
+ story,
} => {
client
.send_reaction(
target_author,
target_timestamp,
remove,
+ story,
)
.await
}
boolean remove,
RecipientIdentifier.Single targetAuthor,
long targetSentTimestamp,
- Set<RecipientIdentifier> recipients
+ Set<RecipientIdentifier> recipients,
+ final boolean isStory
) throws IOException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException, UnregisteredRecipientException;
SendMessageResults sendPaymentNotificationMessage(
boolean remove,
RecipientIdentifier.Single targetAuthor,
long targetSentTimestamp,
- Set<RecipientIdentifier> recipients
+ Set<RecipientIdentifier> recipients,
+ final boolean isStory
) throws IOException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException, UnregisteredRecipientException {
var targetAuthorRecipientId = context.getRecipientHelper().resolveRecipient(targetAuthor);
- var reaction = new SignalServiceDataMessage.Reaction(emoji,
- remove,
- context.getRecipientHelper().resolveSignalServiceAddress(targetAuthorRecipientId).getServiceId(),
- targetSentTimestamp);
+ final var authorServiceId = context.getRecipientHelper()
+ .resolveSignalServiceAddress(targetAuthorRecipientId)
+ .getServiceId();
+ var reaction = new SignalServiceDataMessage.Reaction(emoji, remove, authorServiceId, targetSentTimestamp);
final var messageBuilder = SignalServiceDataMessage.newBuilder().withReaction(reaction);
+ if (isStory) {
+ messageBuilder.withStoryContext(new SignalServiceDataMessage.StoryContext(authorServiceId,
+ targetSentTimestamp));
+ }
return sendMessage(messageBuilder, recipients);
}
*-r*, *--remove*::
Remove a reaction.
+*--story*::
+React to a story instead of a normal message
+
=== sendReceipt
Send a read or viewed receipt to a previously received message.
.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
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());
final boolean remove,
final RecipientIdentifier.Single targetAuthor,
final long targetSentTimestamp,
- final Set<RecipientIdentifier> recipients
+ final Set<RecipientIdentifier> recipients,
+ final boolean isStory
) throws IOException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException {
return handleMessage(recipients,
numbers -> signal.sendMessageReaction(emoji,
targetSentTimestamp,
getSingleRecipientIdentifiers(recipients, m.getSelfNumber()).stream()
.map(RecipientIdentifier.class::cast)
- .collect(Collectors.toSet()));
+ .collect(Collectors.toSet()),
+ false);
checkSendMessageResults(results);
return results.timestamp();
} catch (IOException e) {
remove,
getSingleRecipientIdentifier(targetAuthor, m.getSelfNumber()),
targetSentTimestamp,
- Set.of(getGroupRecipientIdentifier(groupId)));
+ Set.of(getGroupRecipientIdentifier(groupId)),
+ false);
checkSendMessageResults(results);
return results.timestamp();
} catch (IOException e) {