From d701c1ef3dae243aa2046f88288e812bc7e0f8a7 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger <asterix@lagaule.org> Date: Fri, 10 Nov 2006 08:59:14 +0000 Subject: [PATCH] show status changement of contact without a resource only once. fixes #2542 --- src/roster_window.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/roster_window.py b/src/roster_window.py index 2bfde4eb9c..50aa99082b 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -1153,7 +1153,10 @@ class RosterWindow: self.remove_contact(contact, account) self.add_contact_to_roster(contact.jid, account) # print status in chat window and update status/GPG image - for j in (contact.jid, contact.get_full_jid()): + jid_list = [contact.jid] + if contact.get_full_jid() != contact.jid: + jid_list.append(contact.get_full_jid()) + for j in jid_list: if gajim.interface.msg_win_mgr.has_window(j, account): jid = contact.jid win = gajim.interface.msg_win_mgr.get_window(j, account) @@ -1166,11 +1169,12 @@ class RosterWindow: # if multiple resources (or second one disconnecting) if (len(contact_instances) > 1 or (len(contact_instances) == 1 and \ - show in ('offline', 'error'))) and contact.resource != '': + show in ('offline', 'error'))) and contact.resource != '': name += '/' + contact.resource uf_show = helpers.get_uf_show(show) if status: + print '1' ctrl.print_conversation(_('%s is now %s (%s)') % (name, uf_show, status), 'status') else: # No status message -- GitLab