From 55e2b7f0065592f6f7f193c98dbe203fef4546dc Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 9 Nov 2014 15:39:26 +0100 Subject: [PATCH] fix showing self contact when mode is always --- src/roster_window.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/roster_window.py b/src/roster_window.py index eb1d4f935..1717a7a06 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -2645,6 +2645,20 @@ class RosterWindow: self.add_account_contacts(obj.conn.name, improve_speed=False) self.fire_up_unread_messages_events(obj.conn.name) else: + # add self contact + if gajim.config.get('show_self_contact') == 'always': + account = obj.conn.name + self_jid = gajim.get_jid_from_account(account) + if self_jid not in gajim.contacts.get_jid_list(account): + resource = '' + if gajim.connections[account].server_resource: + resource = gajim.connections[account].server_resource + contact = gajim.contacts.create_contact(jid=self_jid, + account=account, name=gajim.nicks[account], + groups=['self_contact'], show='offline', sub='both', + ask='none', resource=resource) + gajim.contacts.add_contact(account, contact) + self.add_contact(self_jid, account) if gajim.config.get('remember_opened_chat_controls'): account = obj.conn.name controls = gajim.config.get_per('accounts', account,