fix read state in self-chat and stop leaking read-marker into it (#18)
Self-chat never showed Read: the outgoing message was promoted by sendDisplayedMarkerIfNeeded, but a later XEP-0184 <received/> receipt or a LMM correction overwrote .read with .delivered/.sent directly, bypassing Delivery.merged. Mark self-addressed outgoing messages read as soon as the server accepts them and merge every weaker status into the ladder instead of overwriting. The self-addressed read-marker carried a plaintext <body>, so clients that do not know our namespace (Conversations, Monal) rendered it as a "Сообщение прочитано" bubble in the self-chat. Service stanzas now ride on their payload element only. Refs #18
This commit is contained in:
@@ -421,6 +421,14 @@ grep -q 'syncReadState' Sources/Shared/Models/AppModel.swift || {
|
||||
echo "Read receipts must be synced to the user's other devices"
|
||||
exit 1
|
||||
}
|
||||
grep -q 'delivery = \$0.delivery.merged(with: .delivered)' Sources/Shared/Models/AppModel.swift || {
|
||||
echo "Delivery receipts must never downgrade an already read message"
|
||||
exit 1
|
||||
}
|
||||
if grep -q 'message.body = Self.readMarkerBody' Sources/Shared/XMPP/XMPPService.swift; then
|
||||
echo "Read-marker service stanzas must not carry a plaintext body (it leaks into self-chat on other clients)"
|
||||
exit 1
|
||||
fi
|
||||
grep -q 'markersPublisher' Sources/Shared/XMPP/XMPPService.swift || {
|
||||
echo "XEP-0333 displayed markers must mark messages as read"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user