introduce a var in order not to duplicate long var
This commit is contained in:
parent
2ccd0183b1
commit
a42c43748c
|
@ -1497,18 +1497,18 @@ _('If "%s" accepts this request you will know his status.') %jid)
|
||||||
self.make_menu()
|
self.make_menu()
|
||||||
|
|
||||||
def new_chat(self, contact, account):
|
def new_chat(self, contact, account):
|
||||||
|
chats = gajim.interface.windows[account]['chats']
|
||||||
if gajim.config.get('usetabbedchat'):
|
if gajim.config.get('usetabbedchat'):
|
||||||
if not gajim.interface.windows[account]['chats'].has_key('tabbed'):
|
if not chats.has_key('tabbed'):
|
||||||
gajim.interface.windows[account]['chats']['tabbed'] = \
|
chats['tabbed'] = tabbed_chat_window.TabbedChatWindow(contact,
|
||||||
tabbed_chat_window.TabbedChatWindow(contact, account)
|
account)
|
||||||
else:
|
else:
|
||||||
gajim.interface.windows[account]['chats']['tabbed'].new_tab(contact)
|
chats['tabbed'].new_tab(contact)
|
||||||
|
|
||||||
gajim.interface.windows[account]['chats'][contact.jid] = \
|
chats[contact.jid] = chats['tabbed']
|
||||||
gajim.interface.windows[account]['chats']['tabbed']
|
|
||||||
else:
|
else:
|
||||||
gajim.interface.windows[account]['chats'][contact.jid] = \
|
chats[contact.jid] = tabbed_chat_window.TabbedChatWindow(contact,
|
||||||
tabbed_chat_window.TabbedChatWindow(contact, account)
|
account)
|
||||||
|
|
||||||
def new_chat_from_jid(self, account, jid):
|
def new_chat_from_jid(self, account, jid):
|
||||||
if gajim.contacts[account].has_key(jid):
|
if gajim.contacts[account].has_key(jid):
|
||||||
|
@ -1840,14 +1840,14 @@ _('If "%s" accepts this request you will know his status.') %jid)
|
||||||
if first_ev:
|
if first_ev:
|
||||||
if self.open_event(account, jid, first_ev):
|
if self.open_event(account, jid, first_ev):
|
||||||
return
|
return
|
||||||
|
chats = gajim.interface.windows[account]['chats']
|
||||||
if gajim.interface.windows[account]['chats'].has_key(jid):
|
if chats.has_key(jid):
|
||||||
gajim.interface.windows[account]['chats'][jid].set_active_tab(jid)
|
chats[jid].set_active_tab(jid)
|
||||||
elif gajim.contacts[account].has_key(jid):
|
elif gajim.contacts[account].has_key(jid):
|
||||||
c = gajim.get_contact_instance_with_highest_priority(account, jid)
|
c = gajim.get_contact_instance_with_highest_priority(account, jid)
|
||||||
self.new_chat(c, account)
|
self.new_chat(c, account)
|
||||||
gajim.interface.windows[account]['chats'][jid].set_active_tab(jid)
|
chats[jid].set_active_tab(jid)
|
||||||
gajim.interface.windows[account]['chats'][jid].window.present()
|
chats[jid].window.present()
|
||||||
|
|
||||||
def on_roster_treeview_row_expanded(self, widget, iter, path):
|
def on_roster_treeview_row_expanded(self, widget, iter, path):
|
||||||
'''When a row is expanded change the icon of the arrow'''
|
'''When a row is expanded change the icon of the arrow'''
|
||||||
|
|
Loading…
Reference in New Issue