From 8d7750b203cc1029d5f0c4fa5bda3acdcf0b81b3 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Wed, 14 May 2008 00:37:06 +0000 Subject: [PATCH] fix multipopup when receiving several unthreaded messages --- src/session.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/session.py b/src/session.py index b7debfeb6..e44f0aa07 100644 --- a/src/session.py +++ b/src/session.py @@ -55,6 +55,10 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession): # dispatch a received stanza def received(self, full_jid_with_resource, msgtxt, tim, encrypted, subject, msg): msg_type = msg.getType() + + if not msg_type: + msg_type = 'normal' + msg_id = None # XEP-0172 User Nickname @@ -114,6 +118,14 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession): jid_of_control = full_jid_with_resource + highest_contact = gajim.contacts.get_contact_with_highest_priority( + self.conn.name, jid) + + if not pm: + if not highest_contact or not highest_contact.resource or \ + resource == highest_contact.resource or highest_contact.show == 'offline': + jid_of_control = jid + # Handle chat states contact = gajim.contacts.get_contact(self.conn.name, jid, resource) if contact: