mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
parent
91ab0b12b0
commit
7b5b5776f0
7 changed files with 64 additions and 22 deletions
|
@ -21,8 +21,12 @@ public record Message(
|
|||
RecipientIdentifier.Single author,
|
||||
String message,
|
||||
List<Mention> mentions,
|
||||
List<TextStyle> textStyles
|
||||
) {}
|
||||
List<TextStyle> textStyles,
|
||||
List<Attachment> attachments
|
||||
) {
|
||||
|
||||
public record Attachment(String contentType, String filename, String preview) {}
|
||||
}
|
||||
|
||||
public record Sticker(byte[] packId, int stickerId) {}
|
||||
|
||||
|
|
|
@ -627,12 +627,19 @@ public class ManagerImpl implements Manager {
|
|||
}
|
||||
if (message.quote().isPresent()) {
|
||||
final var quote = message.quote().get();
|
||||
final var quotedAttachments = new ArrayList<SignalServiceDataMessage.Quote.QuotedAttachment>();
|
||||
for (final var a : quote.attachments()) {
|
||||
final var quotedAttachment = new SignalServiceDataMessage.Quote.QuotedAttachment(a.contentType(),
|
||||
a.filename(),
|
||||
a.preview() == null ? null : context.getAttachmentHelper().uploadAttachment(a.preview()));
|
||||
quotedAttachments.add(quotedAttachment);
|
||||
}
|
||||
messageBuilder.withQuote(new SignalServiceDataMessage.Quote(quote.timestamp(),
|
||||
context.getRecipientHelper()
|
||||
.resolveSignalServiceAddress(context.getRecipientHelper().resolveRecipient(quote.author()))
|
||||
.getServiceId(),
|
||||
quote.message(),
|
||||
List.of(),
|
||||
quotedAttachments,
|
||||
resolveMentions(quote.mentions()),
|
||||
SignalServiceDataMessage.Quote.Type.NORMAL,
|
||||
quote.textStyles().stream().map(TextStyle::toBodyRange).toList()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue