From f66843d83360dd2ae9aa0ed94b3b977e41495d42 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 25 May 2004 16:22:15 +0000 Subject: [PATCH] print a (2) when a user is logged twice with 2 resources --- plugins/gtkgui/gtkgui.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py index e3f2061f9..d1ec68d9f 100644 --- a/plugins/gtkgui/gtkgui.py +++ b/plugins/gtkgui/gtkgui.py @@ -530,16 +530,28 @@ class roster_Window: break else: self.remove_user(user, account) + iters = [] else: + #TODO: should show pibuf of the prioritest resource for i in iters: if self.pixbufs.has_key(show): model.set_value(i, 0, self.pixbufs[show]) + l = len(self.contacts[account][user.jid]) + if l > 1: + for iter in iters: + model.set_value(iter, 1, user.name + " (" + str(l) + ")") + elif l == 1: + for iter in iters: + model.set_value(iter, 1, user.name) for u in self.contacts[account][user.jid]: - u.show = show - u.status = status + if u.resource == user.resource: + u.show = show + u.status = status + break #Print status in chat window if self.plugin.windows[account]['chats'].has_key(user.jid): - if len(self.contacts[account][user.jid]) == 0: + #TODO: should show pibuf of the prioritest resource + if len(self.contacts[account][user.jid]) < 2: self.plugin.windows[account]['chats'][user.jid].\ img.set_from_pixbuf(self.pixbufs[show]) name = user.name