Fix sending read receipts in MUCs

- The "by" attribute of the <stanza-id/> element wasn't being set correctly (it
  was just set to the localpart instead of the full JID, which is out of spec).
- This meant that Conversations (at least) wouldn't trust it, and would try to
  use the origin-id instead, which couldn't be looked up when a chat marker was
  sent to the bridge.
- This fixes that.
- (and adds another space to the put-url debug info)
This commit is contained in:
eta 2020-08-02 11:05:52 +01:00
parent 5f4bcb6c8f
commit b47828c5c1

View file

@ -154,7 +154,7 @@ MEDIA-TYPE is one of (:image :video :audio :document)."
filename length-bytes mime-type) filename length-bytes mime-type)
(lambda (slot) (lambda (slot)
(destructuring-bind ((put-url . headers) get-url) slot (destructuring-bind ((put-url . headers) get-url) slot
(format *debug-io* "~&got put-url: ~A~% get-url: ~A~%" put-url get-url) (format *debug-io* "~&got put-url: ~A~% get-url: ~A~%" put-url get-url)
(with-promise (resolve reject) (with-promise (resolve reject)
(bt:make-thread (bt:make-thread
(lambda () (lambda ()
@ -437,7 +437,10 @@ WhatsXMPP represents users as u440123456789 and groups as g1234-5678."
(cxml:with-element "stanza-id" (cxml:with-element "stanza-id"
(cxml:attribute "xmlns" +unique-stanzas-ns+) (cxml:attribute "xmlns" +unique-stanzas-ns+)
(cxml:attribute "id" xmpp-id) (cxml:attribute "id" xmpp-id)
(cxml:attribute "by" group-localpart)) (cxml:attribute "by" (concatenate 'string
group-localpart
"@"
(component-name comp))))
(cxml:with-element "origin-id" (cxml:with-element "origin-id"
(cxml:attribute "xmlns" +unique-stanzas-ns+) (cxml:attribute "xmlns" +unique-stanzas-ns+)
(cxml:attribute "id" wa-id))) (cxml:attribute "id" wa-id)))