show bookmark title instead of jid in tabs and roster. Fixes #4420

This commit is contained in:
Yann Leboulanger 2008-11-02 14:31:11 +00:00
parent dbaaca08b8
commit f5ae955764
2 changed files with 16 additions and 5 deletions

View File

@ -228,7 +228,13 @@ class GroupchatControl(ChatControlBase):
self.room_jid = self.contact.jid
self.nick = contact.name.decode('utf-8')
self.new_nick = ''
self.name = self.room_jid.split('@')[0]
self.name = ''
for bm in gajim.connections[self.account].bookmarks:
if bm['jid'] == self.room_jid:
self.name = bm['name']
break
if not self.name:
self.name = self.room_jid.split('@')[0]
compact_view = gajim.config.get('compact_view')
self.chat_buttons_set_visible(compact_view)

View File

@ -795,14 +795,19 @@ class RosterWindow:
status = ''
if contact is None:
# New groupchat
contact = gajim.contacts.create_contact(jid=jid, name=jid,
groups=[_('Groupchats')], show=show, status=status, sub='none')
gajim.contacts.add_contact(account, contact)
gc_control = gajim.interface.msg_win_mgr.get_gc_control(jid, account)
if gc_control:
# there is a window that we can minimize
gajim.interface.minimized_controls[account][jid] = gc_control
name = gc_control.name
elif jid in gajim.interface.minimized_controls[account]:
name = gajim.interface.minimized_controls[account][jid].name
else:
name = jid.split('@')[0]
# New groupchat
contact = gajim.contacts.create_contact(jid=jid, name=name,
groups=[_('Groupchats')], show=show, status=status, sub='none')
gajim.contacts.add_contact(account, contact)
self.add_contact(jid, account)
else:
contact.show = show