win.get_controls() isn't needed anymore
This commit is contained in:
parent
e3613be1fa
commit
b21a1e2489
15
src/gajim.py
15
src/gajim.py
|
@ -1034,16 +1034,14 @@ class Interface:
|
||||||
win.set_values(vcard)
|
win.set_values(vcard)
|
||||||
|
|
||||||
# show avatar in chat
|
# show avatar in chat
|
||||||
ctrls = []
|
|
||||||
if resource and self.msg_win_mgr.has_window(fjid, account):
|
if resource and self.msg_win_mgr.has_window(fjid, account):
|
||||||
win = self.msg_win_mgr.get_window(fjid, account)
|
win = self.msg_win_mgr.get_window(fjid, account)
|
||||||
ctrls = win.get_controls(fjid, account)
|
ctrl = win.get_control(fjid, account)
|
||||||
elif self.msg_win_mgr.has_window(jid, account):
|
elif self.msg_win_mgr.has_window(jid, account):
|
||||||
win = self.msg_win_mgr.get_window(jid, account)
|
win = self.msg_win_mgr.get_window(jid, account)
|
||||||
ctrls = win.get_controls(jid, account)
|
ctrl = win.get_control(jid, account)
|
||||||
|
|
||||||
for ctrl in ctrls:
|
if ctrl and ctrl.type_id != message_control.TYPE_GC:
|
||||||
if ctrl.type_id != message_control.TYPE_GC:
|
|
||||||
ctrl.show_avatar()
|
ctrl.show_avatar()
|
||||||
|
|
||||||
# Show avatar in roster or gc_roster
|
# Show avatar in roster or gc_roster
|
||||||
|
@ -2605,9 +2603,7 @@ class Interface:
|
||||||
win = self.msg_win_mgr.get_window(fjid, account)
|
win = self.msg_win_mgr.get_window(fjid, account)
|
||||||
|
|
||||||
if win:
|
if win:
|
||||||
ctrls = win.get_controls(fjid, account)
|
ctrl = win.get_control(fjid, account)
|
||||||
if ctrls:
|
|
||||||
ctrl = ctrls[0]
|
|
||||||
|
|
||||||
if not ctrl:
|
if not ctrl:
|
||||||
ctrl = self.new_chat(contact, account,
|
ctrl = self.new_chat(contact, account,
|
||||||
|
@ -2621,7 +2617,8 @@ class Interface:
|
||||||
|
|
||||||
if gajim.connections[account].is_zeroconf and \
|
if gajim.connections[account].is_zeroconf and \
|
||||||
gajim.connections[account].status in ('offline', 'invisible'):
|
gajim.connections[account].status in ('offline', 'invisible'):
|
||||||
for ctrl in win.get_controls(fjid, account):
|
ctrl = win.get_control(fjid, account)
|
||||||
|
if ctrl:
|
||||||
ctrl.got_disconnected()
|
ctrl.got_disconnected()
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
|
@ -2076,7 +2076,7 @@ class GroupchatControl(ChatControlBase):
|
||||||
gajim.interface.new_private_chat(gc_c, self.account)
|
gajim.interface.new_private_chat(gc_c, self.account)
|
||||||
win = gajim.interface.msg_win_mgr.get_window(nick_jid, self.account)
|
win = gajim.interface.msg_win_mgr.get_window(nick_jid, self.account)
|
||||||
|
|
||||||
ctrl = win.get_controls(nick_jid, self.account)[0]
|
ctrl = win.get_control(nick_jid, self.account)
|
||||||
|
|
||||||
win.set_active_tab(ctrl)
|
win.set_active_tab(ctrl)
|
||||||
|
|
||||||
|
|
|
@ -586,12 +586,6 @@ class MessageWindow(object):
|
||||||
def has_control(self, jid, acct):
|
def has_control(self, jid, acct):
|
||||||
return (acct in self._controls and jid in self._controls[acct])
|
return (acct in self._controls and jid in self._controls[acct])
|
||||||
|
|
||||||
def get_controls(self, jid, acct):
|
|
||||||
try:
|
|
||||||
return self._controls[acct][jid]
|
|
||||||
except KeyError:
|
|
||||||
return []
|
|
||||||
|
|
||||||
def change_key(self, old_jid, new_jid, acct):
|
def change_key(self, old_jid, new_jid, acct):
|
||||||
'''Change the JID key of a control'''
|
'''Change the JID key of a control'''
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -1821,7 +1821,8 @@ class RosterWindow:
|
||||||
account):
|
account):
|
||||||
win = gajim.interface.msg_win_mgr.get_window(jid_with_resource,
|
win = gajim.interface.msg_win_mgr.get_window(jid_with_resource,
|
||||||
account)
|
account)
|
||||||
for ctrl in win.get_controls(jid_with_resource, account):
|
ctrl = win.get_control(jid_with_resource, account)
|
||||||
|
if ctrl:
|
||||||
ctrl.update_ui()
|
ctrl.update_ui()
|
||||||
win.redraw_tab(ctrl)
|
win.redraw_tab(ctrl)
|
||||||
gajim.contacts.remove_contact(account, contact)
|
gajim.contacts.remove_contact(account, contact)
|
||||||
|
@ -1836,7 +1837,8 @@ class RosterWindow:
|
||||||
win = gajim.interface.msg_win_mgr.get_window(contact.jid, account)
|
win = gajim.interface.msg_win_mgr.get_window(contact.jid, account)
|
||||||
uf_show = helpers.get_uf_show(show)
|
uf_show = helpers.get_uf_show(show)
|
||||||
|
|
||||||
for ctrl in win.get_controls(contact.jid, account):
|
ctrl = win.get_control(contact.jid, account)
|
||||||
|
if ctrl:
|
||||||
ctrl.contact = gajim.contacts.get_contact_with_highest_priority(
|
ctrl.contact = gajim.contacts.get_contact_with_highest_priority(
|
||||||
account, contact.jid)
|
account, contact.jid)
|
||||||
ctrl.update_ui()
|
ctrl.update_ui()
|
||||||
|
|
Loading…
Reference in New Issue