diff options
author | mathieui <mathieui@mathieui.net> | 2014-04-25 20:48:40 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2014-04-25 20:48:40 +0200 |
commit | 4a26dea66d9d2f2c2e88cf5e100f312f3c594af1 (patch) | |
tree | 3482e36f5af2b707c090ffd569b4194d3b8987dd | |
parent | b85a3d1c8e1bf1595df928cb7ecc3a6b36b53fed (diff) | |
download | poezio-4a26dea66d9d2f2c2e88cf5e100f312f3c594af1.tar.gz poezio-4a26dea66d9d2f2c2e88cf5e100f312f3c594af1.tar.bz2 poezio-4a26dea66d9d2f2c2e88cf5e100f312f3c594af1.tar.xz poezio-4a26dea66d9d2f2c2e88cf5e100f312f3c594af1.zip |
Fix #2516 (display error with carbons)
- fix the bug where messages from our own jid were incorrectly displayed
- the nick is now fixed for the whole conversation
-rw-r--r-- | src/core/handlers.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/handlers.py b/src/core/handlers.py index bc43cc28..aad0cb37 100644 --- a/src/core/handlers.py +++ b/src/core/handlers.py @@ -179,6 +179,8 @@ def on_normal_message(self, message): if not remote_nick and config.get('enable_user_nick', True): if message.xml.find('{http://jabber.org/protocol/nick}nick') is not None: remote_nick = message['nick']['nick'] + if not remote_nick: + remote_nick = conv_jid.user own = False # we wrote the message (happens with carbons) elif message['from'].bare == self.xmpp.boundjid.bare: @@ -195,11 +197,10 @@ def on_normal_message(self, message): if isinstance(conversation, tabs.DynamicConversationTab): conversation.lock(conv_jid.resource) - if not remote_nick and conversation.nick: + if not own and not conversation.nick: + conversation.nick = remote_nick + elif not own: # keep a fixed nick during the whole conversation remote_nick = conversation.nick - elif not remote_nick or own: - remote_nick = conv_jid.user - conversation.nick = remote_nick self.events.trigger('conversation_msg', message, conversation) if not message['body']: |