Commit 4a26dea6 authored by mathieui's avatar mathieui

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
parent b85a3d1c
......@@ -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('{}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):
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'conversation_msg', message, conversation)
if not message['body']:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment