summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2022-04-10 17:12:13 +0200
committerMaxime “pep” Buquet <pep@bouah.net>2022-04-10 17:12:13 +0200
commit98c57924d4dfc40dcd1c496476d33431fe84f1f2 (patch)
treee759cabfac11e9fe7bea9778d3c0c871a2f7dc6c
parentd9a01bb779839972439ec7b949141aa2d68258f0 (diff)
downloadpoezio-98c57924d4dfc40dcd1c496476d33431fe84f1f2.tar.gz
poezio-98c57924d4dfc40dcd1c496476d33431fe84f1f2.tar.bz2
poezio-98c57924d4dfc40dcd1c496476d33431fe84f1f2.tar.xz
poezio-98c57924d4dfc40dcd1c496476d33431fe84f1f2.zip
Ensure we only ignore our own reflections in 1:1
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--poezio/tabs/conversationtab.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/poezio/tabs/conversationtab.py b/poezio/tabs/conversationtab.py
index ab364649..f6b5708b 100644
--- a/poezio/tabs/conversationtab.py
+++ b/poezio/tabs/conversationtab.py
@@ -110,11 +110,20 @@ class ConversationTab(OneToOneTab):
The message can come from us (carbon copy).
"""
+
+ # Prevent messages coming from our own devices (1:1) to be reflected
+ if message['to'].bare == self.core.xmpp.boundjid.bare and \
+ message['from'].bare == self.core.xmpp.boundjid.bare:
+ _, index = self._text_buffer._find_message(message['id'])
+ if index != -1:
+ return
+
use_xhtml = config.get_by_tabname(
'enable_xhtml_im',
message['from'].bare
)
tmp_dir = get_image_cache()
+
# normal message, we are the recipient
if message['to'].bare == self.core.xmpp.boundjid.bare:
conv_jid = message['from']
@@ -123,13 +132,6 @@ class ConversationTab(OneToOneTab):
self.last_remote_message = datetime.now()
remote_nick = self.get_nick()
# we wrote the message (happens with carbons)
- elif message['from'].full == self.core.xmpp.boundjid.full:
- # XXX: We shouldn't look through messages that have been displayed
- # but through messages that have been logged. These don't include
- # IDs though.
- _, index = self._text_buffer._find_message(message['id'])
- if index != -1: # The id has been found
- return
elif message['from'].bare == self.core.xmpp.boundjid.bare:
conv_jid = message['to']
jid = self.core.xmpp.boundjid