Philipp Hörist pushed to branch master at gajim / gajim

Commits:
e3050697 by Philipp Hörist at 2018-11-19T18:33:28Z
Fix receipts for MUC-PMs

- - - - -


1 changed file:

- gajim/common/modules/receipts.py


Changes:

=====================================
gajim/common/modules/receipts.py
=====================================
@@ -72,15 +72,15 @@ class Receipts:
         self._con.connection.send(receipt)
 
     def _get_contact(self, event):
-        if event.mtype == 'chat':
-            contact = app.contacts.get_contact(self._account, event.jid)
-            if contact and contact.sub not in ('to', 'none'):
-                return contact
-        else:
+        if event.muc_pm:
             return app.contacts.get_gc_contact(self._account,
                                                event.jid,
                                                event.resource)
 
+        contact = app.contacts.get_contact(self._account, event.jid)
+        if contact is None and contact.sub not in ('to', 'none'):
+            return contact
+
     @staticmethod
     def _build_answer_receipt(to, receipt_id):
         receipt = nbxmpp.Message(to=to, typ='chat')
@@ -95,11 +95,16 @@ class Receipts:
             log.warning('Receipt without ID: %s', event.stanza)
             return
         log.info('Received %s', receipt_id)
+
+        jid = event.jid
+        if event.muc_pm:
+            jid = event.fjid
+
         app.nec.push_incoming_event(
             NetworkIncomingEvent('receipt-received',
                                  conn=self._con,
                                  receipt_id=receipt_id,
-                                 jid=event.jid))
+                                 jid=jid))
 
 
 def get_instance(*args, **kwargs):



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/e30506979899bcb338010a4f59e0c2133fa778f4

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/e30506979899bcb338010a4f59e0c2133fa778f4
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to