fix ConversationTab's nicks when a contact has no name

This commit is contained in:
louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 2011-01-05 01:14:30 +00:00
parent 4ace901909
commit 6de2673c8f

View file

@ -496,9 +496,9 @@ class Core(object):
# We create the conversation with the bare Jid if nothing was found # We create the conversation with the bare Jid if nothing was found
conversation = self.open_conversation_window(jid.bare, False) conversation = self.open_conversation_window(jid.bare, False)
if roster.get_contact_by_jid(jid.bare): if roster.get_contact_by_jid(jid.bare):
remote_nick = roster.get_contact_by_jid(jid.bare).get_name() remote_nick = roster.get_contact_by_jid(jid.bare).get_name() or jid.user
else: else:
remote_nick = jid.full remote_nick = jid.user
conversation.get_room().add_message(body, None, remote_nick, False, theme.COLOR_REMOTE_USER) conversation.get_room().add_message(body, None, remote_nick, False, theme.COLOR_REMOTE_USER)
if self.current_tab() is not conversation: if self.current_tab() is not conversation:
conversation.set_color_state(theme.COLOR_TAB_PRIVATE) conversation.set_color_state(theme.COLOR_TAB_PRIVATE)