Fix receipts for MUC-PMs
This commit is contained in:
parent
b5bd5f15f0
commit
e305069798
|
@ -72,15 +72,15 @@ class Receipts:
|
||||||
self._con.connection.send(receipt)
|
self._con.connection.send(receipt)
|
||||||
|
|
||||||
def _get_contact(self, event):
|
def _get_contact(self, event):
|
||||||
if event.mtype == 'chat':
|
if event.muc_pm:
|
||||||
contact = app.contacts.get_contact(self._account, event.jid)
|
|
||||||
if contact and contact.sub not in ('to', 'none'):
|
|
||||||
return contact
|
|
||||||
else:
|
|
||||||
return app.contacts.get_gc_contact(self._account,
|
return app.contacts.get_gc_contact(self._account,
|
||||||
event.jid,
|
event.jid,
|
||||||
event.resource)
|
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
|
@staticmethod
|
||||||
def _build_answer_receipt(to, receipt_id):
|
def _build_answer_receipt(to, receipt_id):
|
||||||
receipt = nbxmpp.Message(to=to, typ='chat')
|
receipt = nbxmpp.Message(to=to, typ='chat')
|
||||||
|
@ -95,11 +95,16 @@ class Receipts:
|
||||||
log.warning('Receipt without ID: %s', event.stanza)
|
log.warning('Receipt without ID: %s', event.stanza)
|
||||||
return
|
return
|
||||||
log.info('Received %s', receipt_id)
|
log.info('Received %s', receipt_id)
|
||||||
|
|
||||||
|
jid = event.jid
|
||||||
|
if event.muc_pm:
|
||||||
|
jid = event.fjid
|
||||||
|
|
||||||
app.nec.push_incoming_event(
|
app.nec.push_incoming_event(
|
||||||
NetworkIncomingEvent('receipt-received',
|
NetworkIncomingEvent('receipt-received',
|
||||||
conn=self._con,
|
conn=self._con,
|
||||||
receipt_id=receipt_id,
|
receipt_id=receipt_id,
|
||||||
jid=event.jid))
|
jid=jid))
|
||||||
|
|
||||||
|
|
||||||
def get_instance(*args, **kwargs):
|
def get_instance(*args, **kwargs):
|
||||||
|
|
Loading…
Reference in New Issue