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

Commits:

1 changed file:

Changes:

  • gajim/common/modules/receipts.py
    ... ... @@ -72,15 +72,15 @@ class Receipts:
    72 72
             self._con.connection.send(receipt)
    
    73 73
     
    
    74 74
         def _get_contact(self, event):
    
    75
    -        if event.mtype == 'chat':
    
    76
    -            contact = app.contacts.get_contact(self._account, event.jid)
    
    77
    -            if contact and contact.sub not in ('to', 'none'):
    
    78
    -                return contact
    
    79
    -        else:
    
    75
    +        if event.muc_pm:
    
    80 76
                 return app.contacts.get_gc_contact(self._account,
    
    81 77
                                                    event.jid,
    
    82 78
                                                    event.resource)
    
    83 79
     
    
    80
    +        contact = app.contacts.get_contact(self._account, event.jid)
    
    81
    +        if contact is None and contact.sub not in ('to', 'none'):
    
    82
    +            return contact
    
    83
    +
    
    84 84
         @staticmethod
    
    85 85
         def _build_answer_receipt(to, receipt_id):
    
    86 86
             receipt = nbxmpp.Message(to=to, typ='chat')
    
    ... ... @@ -95,11 +95,16 @@ class Receipts:
    95 95
                 log.warning('Receipt without ID: %s', event.stanza)
    
    96 96
                 return
    
    97 97
             log.info('Received %s', receipt_id)
    
    98
    +
    
    99
    +        jid = event.jid
    
    100
    +        if event.muc_pm:
    
    101
    +            jid = event.fjid
    
    102
    +
    
    98 103
             app.nec.push_incoming_event(
    
    99 104
                 NetworkIncomingEvent('receipt-received',
    
    100 105
                                      conn=self._con,
    
    101 106
                                      receipt_id=receipt_id,
    
    102
    -                                 jid=event.jid))
    
    107
    +                                 jid=jid))
    
    103 108
     
    
    104 109
     
    
    105 110
     def get_instance(*args, **kwargs):