mark outgoing 1:1 messages <markable/> so peers can send displayed markers (#18)
Martin only attaches <request/> (XEP-0184 receipts) in createMessage, so Conversations/Monal had no licence to answer with <displayed/> and read state was stuck on delivered. MUC stays exempt per XEP-0333.
This commit is contained in:
1 parent
338affd89e
commit
0d6c562abd
2 files changed
+11
No files matched your search
@@ -429,6 +429,10 @@ if grep -q 'message.body = Self.readMarkerBody' Sources/Shared/XMPP/XMPPService.
|
||||
echo "Read-marker service stanzas must not carry a plaintext body (it leaks into self-chat on other clients)"
|
||||
exit 1
|
||||
fi
|
||||
grep -q 'message.isMarkable = true' Sources/Shared/XMPP/XMPPService.swift || {
|
||||
echo "Outgoing 1:1 messages must be <markable/> or peers never answer with <displayed/>"
|
||||
exit 1
|
||||
}
|
||||
grep -q 'markersPublisher' Sources/Shared/XMPP/XMPPService.swift || {
|
||||
echo "XEP-0333 displayed markers must mark messages as read"
|
||||
exit 1
|
||||
|
||||
@@ -967,6 +967,13 @@ final class XMPPService {
|
||||
|
||||
let message = chat.createMessage(text: wireBody, id: messageID)
|
||||
addOriginID(messageID, to: message)
|
||||
// XEP-0333: peers only answer with `<displayed/>` when the outgoing
|
||||
// stanza is marked `<markable/>`. Martin adds `<request/>` (receipts)
|
||||
// on its own but never markable, so 1:1 read state stayed stuck on
|
||||
// "delivered". The element stays outside the OMEMO payload, which is
|
||||
// exactly where Monal/Conversations look for it. MUC is exempt —
|
||||
// XEP-0333 forbids markers in groupchats.
|
||||
message.isMarkable = true
|
||||
message.lastMessageCorrectionId = replacingMessageID
|
||||
if chatStatesEnabled { message.chatState = .active }
|
||||
addReply(replyTo, fallback: replyFallback, to: message)
|
||||
|
||||
Reference in new issue
Block a user