fix showing self contact when mode is always

This commit is contained in:
Yann Leboulanger 2014-11-09 15:39:26 +01:00
parent f42499acdb
commit 55e2b7f006
1 changed files with 14 additions and 0 deletions

View File

@ -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,