mirror of
https://github.com/aljazceru/signal-cli.git
synced 2025-12-27 11:04:24 +01:00
add JsonPayment (#808)
This commit is contained in:
@@ -101,6 +101,7 @@ public record MessageEnvelope(
|
||||
boolean hasProfileKey,
|
||||
Optional<Reaction> reaction,
|
||||
Optional<Quote> quote,
|
||||
Optional<Payment> payment,
|
||||
List<Attachment> attachments,
|
||||
Optional<Long> remoteDeleteId,
|
||||
Optional<Sticker> sticker,
|
||||
@@ -130,6 +131,9 @@ public record MessageEnvelope(
|
||||
Optional.ofNullable(dataMessage.getQuote()
|
||||
.transform(q -> Quote.from(q, recipientResolver, addressResolver, fileProvider))
|
||||
.orNull()),
|
||||
Optional.ofNullable(dataMessage.getPayment()
|
||||
.transform(p -> p.getPaymentNotification().isPresent() ? Payment.from(p) : null)
|
||||
.orNull()),
|
||||
dataMessage.getAttachments()
|
||||
.transform(a -> a.stream()
|
||||
.map(as -> Attachment.from(as, fileProvider))
|
||||
@@ -229,6 +233,12 @@ public record MessageEnvelope(
|
||||
}
|
||||
}
|
||||
|
||||
public record Payment(String note, byte[] receipt) {
|
||||
static Payment from(SignalServiceDataMessage.Payment payment) {
|
||||
return new Payment(payment.getPaymentNotification().get().getNote(), payment.getPaymentNotification().get().getReceipt());
|
||||
}
|
||||
}
|
||||
|
||||
public record Mention(RecipientAddress recipient, int start, int length) {
|
||||
|
||||
static Mention from(
|
||||
|
||||
Reference in New Issue
Block a user