mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Implement replying to stories
This commit is contained in:
parent
fea19c9e20
commit
5ed9db4f08
8 changed files with 54 additions and 6 deletions
|
@ -624,6 +624,14 @@ class ManagerImpl implements Manager {
|
|||
}
|
||||
messageBuilder.withPreviews(previews);
|
||||
}
|
||||
if (message.storyReply().isPresent()) {
|
||||
final var storyReply = message.storyReply().get();
|
||||
final var authorServiceId = context.getRecipientHelper()
|
||||
.resolveSignalServiceAddress(context.getRecipientHelper().resolveRecipient(storyReply.author()))
|
||||
.getServiceId();
|
||||
messageBuilder.withStoryContext(new SignalServiceDataMessage.StoryContext(authorServiceId,
|
||||
storyReply.timestamp()));
|
||||
}
|
||||
}
|
||||
|
||||
private ArrayList<SignalServiceDataMessage.Mention> resolveMentions(final List<Message.Mention> mentionList) throws UnregisteredRecipientException {
|
||||
|
|
|
@ -9,7 +9,8 @@ public record Message(
|
|||
List<Mention> mentions,
|
||||
Optional<Quote> quote,
|
||||
Optional<Sticker> sticker,
|
||||
List<Preview> previews
|
||||
List<Preview> previews,
|
||||
Optional<StoryReply> storyReply
|
||||
) {
|
||||
|
||||
public record Mention(RecipientIdentifier.Single recipient, int start, int length) {}
|
||||
|
@ -19,4 +20,6 @@ public record Message(
|
|||
public record Sticker(byte[] packId, int stickerId) {}
|
||||
|
||||
public record Preview(String url, String title, String description, Optional<String> image) {}
|
||||
|
||||
public record StoryReply(long timestamp, RecipientIdentifier.Single author) {}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue