Zom-iOS-XMPP icon indicating copy to clipboard operation
Zom-iOS-XMPP copied to clipboard

Delivery receipts in OMEMO groups

Open cstiens opened this issue 7 years ago • 8 comments

cstiens avatar Mar 29 '18 16:03 cstiens

@chrisballinger It seems the problem lies in XMPPFramework, Extensions/XEP-0184/XMPPMessageDeliveryReceipts.m, line 143. We don't request receipts for group messages. Is there a particular reason for this? If I comment out that check everything seems to work for me.

N-Pex avatar Apr 18 '18 09:04 N-Pex

What should I see when testing?

What I am seeing: Whoever has OMEMO turned on in the group:

  • gets double checks and a shield when they send messages (provided the messages go thru).
  • sends a message to them, they see a shield next to the delivered message.

If someone does NOT have OMEMO turned on in the group:

  • they see double checks when they send messages.
  • if someone with OMEMO turned on sends them a message, the person who does not have OMEMO turned on sees a shield next to the delivered message.

Device: iPhone 6, iPhone 7, iPad OS: 10.3.3, 11.2.2, 10.3.2 App version: build 129

tiffrobo avatar Apr 20 '18 20:04 tiffrobo

@N-Pex Ah good catch. I'm not sure the original reasoning. We do manually add the receipt request:

    @objc public func sendRoomMessage(_ message: OTRXMPPRoomMessage) {
        let elementId = message.xmppId ?? message.uniqueId
        let body = XMLElement(name: "body", stringValue: message.messageText)
        let xmppMessage = XMPPMessage(messageType: nil, to: nil, elementID: elementId, child: body)
        xmppMessage.addReceiptRequest()
        let originId = message.originId ?? message.xmppId ?? message.uniqueId
        xmppMessage.addOriginId(originId)
        send(xmppMessage)
    }

Wonder why that doesn't work as expected.

chrisballinger avatar Apr 22 '18 22:04 chrisballinger

@chrisballinger Because the OMEMO group messages never go down that path, please see MessageQueueHandler.sendGroupMessage. Do you want me to submit a pull request for XMPPFramework (Robbie's upstream repo) or should we just add "addReceiptRequest()" to the other places where it's needed?

N-Pex avatar Apr 27 '18 12:04 N-Pex

I think either approach is fine. If you put a PR for XMPPFramework I'd suggest adding a BOOL option that retains the old behavior by default. The sending was decoupled from OMEMOModule a while ago so it's a lot easier to do manually: https://github.com/robbiehanson/XMPPFramework/blob/master/Extensions/OMEMO/OMEMOModule.h#L132

chrisballinger avatar Apr 27 '18 15:04 chrisballinger

@N-Pex will you close this or tag it with 'Test Again' when you feel that your part of the work is done?

cstiens avatar Apr 28 '18 18:04 cstiens

Ok, should work in build 130

N-Pex avatar May 04 '18 08:05 N-Pex

Thanks @N-Pex I'm going to move this to the 'test again' milestone so we can keep our eye on how consistent the delivery receipts are. So, far, they are showing up now!

cstiens avatar May 11 '18 15:05 cstiens