diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2004-05-20 19:43:41 +0400 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2004-05-20 19:43:41 +0400 |
commit | 360570cf2de86cc6dc17af5eda5fb465cdd00af7 (patch) | |
tree | 5ca45d86c2b53c26df577b0bc455eb99ede3247c /plugins | |
parent | 2860211def5edd4311e50c47ffc257d9f4d23306 (diff) |
bugfix : we can recieve messages from offline contacts (invisible or offline stored messages). In thoses cases do not select contact in roster.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/gtkgui/gtkgui.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py index c515e6ca8..6a3305df6 100644 --- a/plugins/gtkgui/gtkgui.py +++ b/plugins/gtkgui/gtkgui.py @@ -805,7 +805,10 @@ class roster_Window: 'not in list', 'not in list', 'none', '') self.add_user_to_roster(user1, account) iter = self.get_user_iter(jid, account) - path = self.tree.get_model().get_path(iter) + if iter: + path = self.tree.get_model().get_path(iter[0]) + else: + path = None autopopup = self.plugin.config['autopopup'] if autopopup == 0 and not \ self.plugin.windows[account]['chats'].has_key(jid): @@ -817,18 +820,20 @@ class roster_Window: model.set_value(i, 0, self.pixbufs['message']) tim = time.strftime("[%H:%M:%S]") self.plugin.queues[account][jid].put((msg, tim)) - self.tree.expand_row(path[0:1], FALSE) - self.tree.expand_row(path[0:2], FALSE) - self.tree.scroll_to_cell(path) - self.tree.set_cursor(path) - else: - if not self.plugin.windows[account]['chats'].has_key(jid): + if path: self.tree.expand_row(path[0:1], FALSE) self.tree.expand_row(path[0:2], FALSE) self.tree.scroll_to_cell(path) self.tree.set_cursor(path) + else: + if not self.plugin.windows[account]['chats'].has_key(jid): self.plugin.windows[account]['chats'][jid] = \ message_Window(self.contacts[account][jid], self.plugin, account) + if path: + self.tree.expand_row(path[0:1], FALSE) + self.tree.expand_row(path[0:2], FALSE) + self.tree.scroll_to_cell(path) + self.tree.set_cursor(path) self.plugin.windows[account]['chats'][jid].print_conversation(msg) def on_prefs(self, widget): |