Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYann Leboulanger <asterix@lagaule.org>2008-07-31 17:34:19 +0400
committerYann Leboulanger <asterix@lagaule.org>2008-07-31 17:34:19 +0400
commit56598c447bdb69e27cadb4ba903d7f2a731cca32 (patch)
tree554c5ffe1ce0d0828e9a53a3a52f689d8298c8e1 /src
parentd23612c90482b61d71f42712a2c87bddc90c1bf7 (diff)
don't look for a contact when we double click on an account row
Diffstat (limited to 'src')
-rw-r--r--src/roster_window.py89
1 files changed, 46 insertions, 43 deletions
diff --git a/src/roster_window.py b/src/roster_window.py
index 6d74ddaf9..d513c64be 100644
--- a/src/roster_window.py
+++ b/src/roster_window.py
@@ -3456,16 +3456,17 @@ class RosterWindow:
model = self.modelfilter
account = model[path][C_ACCOUNT].decode('utf-8')
type_ = model[path][C_TYPE]
- jid = model[path][C_JID].decode('utf-8')
- resource = None
- contact = gajim.contacts.get_first_contact_from_jid(account, jid)
- titer = model.get_iter(path)
if type_ in ('group', 'account'):
if self.tree.row_expanded(path):
self.tree.collapse_row(path)
else:
self.tree.expand_row(path, False)
- elif contact.is_groupchat():
+ return
+ jid = model[path][C_JID].decode('utf-8')
+ resource = None
+ contact = gajim.contacts.get_first_contact_from_jid(account, jid)
+ titer = model.get_iter(path)
+ if contact.is_groupchat():
first_ev = gajim.events.get_first_event(account, jid)
if first_ev and self.open_event(account, jid, first_ev):
# We are invited to a GC
@@ -3473,44 +3474,46 @@ class RosterWindow:
self.remove_groupchat(jid, account)
else:
self.on_groupchat_maximized(None, jid, account)
- else:
- first_ev = gajim.events.get_first_event(account, jid)
- if not first_ev:
- # look in other resources
- for c in gajim.contacts.get_contacts(account, jid):
- fjid = c.get_full_jid()
- first_ev = gajim.events.get_first_event(account, fjid)
- if first_ev:
- resource = c.resource
- break
- if not first_ev and model.iter_has_child(titer):
- child_iter = model.iter_children(titer)
- while not first_ev and child_iter:
- child_jid = model[child_iter][C_JID].decode('utf-8')
- first_ev = gajim.events.get_first_event(account, child_jid)
- if first_ev:
- jid = child_jid
- else:
- child_iter = model.iter_next(child_iter)
- session = None
- if first_ev:
- if first_ev.type_ in ('chat', 'normal'):
- session = first_ev.parameters[8]
- fjid = jid
- if resource:
- fjid += '/' + resource
- if self.open_event(account, fjid, first_ev):
- return
- # else
- contact = gajim.contacts.get_contact(account, jid, resource)
- if not contact or isinstance(contact, list):
- contact = \
- gajim.contacts.get_contact_with_highest_priority(account, jid)
- if jid == gajim.get_jid_from_account(account):
- resource = contact.resource
-
- gajim.interface.on_open_chat_window(None, contact, account, \
- resource = resource, session = session)
+ return
+
+ # else
+ first_ev = gajim.events.get_first_event(account, jid)
+ if not first_ev:
+ # look in other resources
+ for c in gajim.contacts.get_contacts(account, jid):
+ fjid = c.get_full_jid()
+ first_ev = gajim.events.get_first_event(account, fjid)
+ if first_ev:
+ resource = c.resource
+ break
+ if not first_ev and model.iter_has_child(titer):
+ child_iter = model.iter_children(titer)
+ while not first_ev and child_iter:
+ child_jid = model[child_iter][C_JID].decode('utf-8')
+ first_ev = gajim.events.get_first_event(account, child_jid)
+ if first_ev:
+ jid = child_jid
+ else:
+ child_iter = model.iter_next(child_iter)
+ session = None
+ if first_ev:
+ if first_ev.type_ in ('chat', 'normal'):
+ session = first_ev.parameters[8]
+ fjid = jid
+ if resource:
+ fjid += '/' + resource
+ if self.open_event(account, fjid, first_ev):
+ return
+ # else
+ contact = gajim.contacts.get_contact(account, jid, resource)
+ if not contact or isinstance(contact, list):
+ contact = gajim.contacts.get_contact_with_highest_priority(account,
+ jid)
+ if jid == gajim.get_jid_from_account(account):
+ resource = contact.resource
+
+ gajim.interface.on_open_chat_window(None, contact, account, \
+ resource=resource, session=session)
def on_roster_treeview_row_activated(self, widget, path, col = 0):
'''When an iter is double clicked: open the first event window'''