diff options
author | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2011-01-03 15:07:32 +0000 |
---|---|---|
committer | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2011-01-03 15:07:32 +0000 |
commit | 59195ffaffa791169e31e4d6b5804ea9d697e67f (patch) | |
tree | 6608fc3ce8538f3e118390cb82fd5a6ad4a71e15 | |
parent | ab85a3dc219ac3b64d7294deb52847c093a2a516 (diff) | |
download | poezio-59195ffaffa791169e31e4d6b5804ea9d697e67f.tar.gz poezio-59195ffaffa791169e31e4d6b5804ea9d697e67f.tar.bz2 poezio-59195ffaffa791169e31e4d6b5804ea9d697e67f.tar.xz poezio-59195ffaffa791169e31e4d6b5804ea9d697e67f.zip |
display the 'nickname' instead of the JID
-rw-r--r-- | src/core.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core.py b/src/core.py index b46bd003..d7fa3157 100644 --- a/src/core.py +++ b/src/core.py @@ -97,7 +97,7 @@ class Core(object): self.tabs = [default_tab] self.resize_timer = None self.previous_tab_nb = 0 - self.own_nick = config.get('own_nick', self.xmpp.boundjid.bare) + self.own_nick = config.get('own_nick', '') or self.xmpp.boundjid.user # global commands, available from all tabs # a command is tuple of the form: # (the function executing the command. Takes a string as argument, @@ -490,7 +490,11 @@ class Core(object): if not conversation: # We create the conversation with the bare Jid if nothing was found conversation = self.open_conversation_window(jid.bare, False) - conversation.get_room().add_message(body, None, jid.full, False, theme.COLOR_REMOTE_USER) + if roster.get_contact_by_jid(jid.bare): + remote_nick = roster.get_contact_by_jid(jid.bare).get_name() + else: + remote_nick = jid.full + conversation.get_room().add_message(body, None, remote_nick, False, theme.COLOR_REMOTE_USER) if self.current_tab() is not conversation: conversation.set_color_state(theme.COLOR_TAB_PRIVATE) self.refresh_window() |