get the correct gc_control according to the account when we want to print error message in it. Fixes #2456

This commit is contained in:
Yann Leboulanger 2006-10-03 10:03:07 +00:00
parent f34c41c93b
commit 8b494b8ff7
1 changed files with 25 additions and 25 deletions

View File

@ -619,17 +619,17 @@ class Interface:
full_jid_with_resource = array[0]
jids = full_jid_with_resource.split('/', 1)
jid = jids[0]
gcs = self.msg_win_mgr.get_controls(message_control.TYPE_GC)
for gc_control in gcs:
if jid == gc_control.contact.jid:
gc_control = self.msg_win_mgr.get_control(jid, account)
if gc_control:
if len(jids) > 1: # it's a pm
nick = jids[1]
if not self.msg_win_mgr.get_control(full_jid_with_resource, account):
if not self.msg_win_mgr.get_control(full_jid_with_resource,
account):
tv = gc_control.list_treeview
model = tv.get_model()
i = gc_control.get_contact_iter(nick)
if i:
show = model[i][3]
iter = gc_control.get_contact_iter(nick)
if iter:
show = model[iter][3]
else:
show = 'offline'
gc_c = gajim.contacts.create_gc_contact(room_jid = jid,