Ignore quotes without author

Fixes #1369
This commit is contained in:
AsamK 2023-11-08 12:40:34 +01:00
parent 87105272d1
commit a5187d4481

View file

@ -140,7 +140,9 @@ public record MessageEnvelope(
dataMessage.isProfileKeyUpdate(), dataMessage.isProfileKeyUpdate(),
dataMessage.getProfileKey().isPresent(), dataMessage.getProfileKey().isPresent(),
dataMessage.getReaction().map(r -> Reaction.from(r, recipientResolver, addressResolver)), dataMessage.getReaction().map(r -> Reaction.from(r, recipientResolver, addressResolver)),
dataMessage.getQuote().map(q -> Quote.from(q, recipientResolver, addressResolver, fileProvider)), dataMessage.getQuote()
.filter(q -> q.getAuthor() != null && q.getAuthor().isValid())
.map(q -> Quote.from(q, recipientResolver, addressResolver, fileProvider)),
dataMessage.getPayment().map(p -> p.getPaymentNotification().isPresent() ? Payment.from(p) : null), dataMessage.getPayment().map(p -> p.getPaymentNotification().isPresent() ? Payment.from(p) : null),
dataMessage.getAttachments() dataMessage.getAttachments()
.map(a -> a.stream().map(as -> Attachment.from(as, fileProvider)).toList()) .map(a -> a.stream().map(as -> Attachment.from(as, fileProvider)).toList())