Dont use message receipts in message to ourself
This commit is contained in:
parent
c49d13bcae
commit
33a584b8b0
|
@ -978,11 +978,11 @@ class ChatControl(ChatControlBase):
|
||||||
|
|
||||||
def _on_sent(obj, msg_stanza, message, encrypted, xhtml, label):
|
def _on_sent(obj, msg_stanza, message, encrypted, xhtml, label):
|
||||||
id_ = msg_stanza.getID()
|
id_ = msg_stanza.getID()
|
||||||
if self.contact.supports(NS_RECEIPTS) and gajim.config.get_per(
|
xep0184_id = None
|
||||||
'accounts', self.account, 'request_receipt'):
|
if self.contact.jid != gajim.get_jid_from_account(self.account):
|
||||||
xep0184_id = id_
|
if self.contact.supports(NS_RECEIPTS) and gajim.config.get_per(
|
||||||
else:
|
'accounts', self.account, 'request_receipt'):
|
||||||
xep0184_id = None
|
xep0184_id = id_
|
||||||
if label:
|
if label:
|
||||||
displaymarking = label.getTag('displaymarking')
|
displaymarking = label.getTag('displaymarking')
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -467,10 +467,11 @@ class CommonConnection:
|
||||||
namespace=nbxmpp.NS_MSG_HINTS)
|
namespace=nbxmpp.NS_MSG_HINTS)
|
||||||
|
|
||||||
# XEP-0184
|
# XEP-0184
|
||||||
if msgtxt and gajim.config.get_per('accounts', self.name,
|
if obj.jid != gajim.get_jid_from_account(self.name):
|
||||||
'request_receipt') and contact and contact.supports(
|
if msgtxt and gajim.config.get_per('accounts', self.name,
|
||||||
nbxmpp.NS_RECEIPTS):
|
'request_receipt') and contact and contact.supports(
|
||||||
msg_iq.setTag('request', namespace=nbxmpp.NS_RECEIPTS)
|
nbxmpp.NS_RECEIPTS):
|
||||||
|
msg_iq.setTag('request', namespace=nbxmpp.NS_RECEIPTS)
|
||||||
|
|
||||||
if obj.forward_from:
|
if obj.forward_from:
|
||||||
addresses = msg_iq.addChild('addresses',
|
addresses = msg_iq.addChild('addresses',
|
||||||
|
|
|
@ -1174,17 +1174,19 @@ class ConnectionHandlersBase:
|
||||||
jid_to = gajim.get_jid_without_resource(fjid_to)
|
jid_to = gajim.get_jid_without_resource(fjid_to)
|
||||||
if jid_to == gajim.get_jid_from_account(self.name):
|
if jid_to == gajim.get_jid_from_account(self.name):
|
||||||
reply = True
|
reply = True
|
||||||
if obj.receipt_request_tag and gajim.config.get_per('accounts',
|
|
||||||
self.name, 'answer_receipts') and ((contact and contact.sub \
|
|
||||||
not in ('to', 'none')) or gc_contact) and obj.mtype != 'error' and \
|
|
||||||
reply:
|
|
||||||
receipt = nbxmpp.Message(to=obj.fjid, typ='chat')
|
|
||||||
receipt.setTag('received', namespace='urn:xmpp:receipts',
|
|
||||||
attrs={'id': obj.id_})
|
|
||||||
|
|
||||||
if obj.thread_id:
|
if obj.jid != gajim.get_jid_from_account(self.name):
|
||||||
receipt.setThread(obj.thread_id)
|
if obj.receipt_request_tag and gajim.config.get_per('accounts',
|
||||||
self.connection.send(receipt)
|
self.name, 'answer_receipts') and ((contact and contact.sub \
|
||||||
|
not in ('to', 'none')) or gc_contact) and obj.mtype != 'error' and \
|
||||||
|
reply:
|
||||||
|
receipt = nbxmpp.Message(to=obj.fjid, typ='chat')
|
||||||
|
receipt.setTag('received', namespace='urn:xmpp:receipts',
|
||||||
|
attrs={'id': obj.id_})
|
||||||
|
|
||||||
|
if obj.thread_id:
|
||||||
|
receipt.setThread(obj.thread_id)
|
||||||
|
self.connection.send(receipt)
|
||||||
|
|
||||||
# We got our message's receipt
|
# We got our message's receipt
|
||||||
if obj.receipt_received_tag and gajim.config.get_per('accounts',
|
if obj.receipt_received_tag and gajim.config.get_per('accounts',
|
||||||
|
|
|
@ -2734,7 +2734,8 @@ class RosterWindow:
|
||||||
typ = 'error'
|
typ = 'error'
|
||||||
if obj.forwarded and obj.sent:
|
if obj.forwarded and obj.sent:
|
||||||
typ = 'out'
|
typ = 'out'
|
||||||
xep0184_id = obj.id_
|
if obj.jid != gajim.get_jid_from_account(obj.conn.name):
|
||||||
|
xep0184_id = obj.id_
|
||||||
|
|
||||||
obj.session.control.print_conversation(obj.msgtxt, typ,
|
obj.session.control.print_conversation(obj.msgtxt, typ,
|
||||||
tim=obj.timestamp, encrypted=obj.encrypted, subject=obj.subject,
|
tim=obj.timestamp, encrypted=obj.encrypted, subject=obj.subject,
|
||||||
|
|
Loading…
Reference in New Issue