mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Implement reacting to stories
This commit is contained in:
parent
207764e0be
commit
fea19c9e20
9 changed files with 33 additions and 10 deletions
|
@ -136,7 +136,8 @@ public interface Manager extends Closeable {
|
|||
boolean remove,
|
||||
RecipientIdentifier.Single targetAuthor,
|
||||
long targetSentTimestamp,
|
||||
Set<RecipientIdentifier> recipients
|
||||
Set<RecipientIdentifier> recipients,
|
||||
final boolean isStory
|
||||
) throws IOException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException, UnregisteredRecipientException;
|
||||
|
||||
SendMessageResults sendPaymentNotificationMessage(
|
||||
|
|
|
@ -667,14 +667,19 @@ class ManagerImpl implements Manager {
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue