From 278ba237f94f0b7b31b08527fbb0e5a62bd294d4 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 24 Oct 2010 15:33:19 +0200 Subject: [PATCH] check real JID <-> fake JID correspondance only when needed. --- src/common/connection_handlers_events.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/common/connection_handlers_events.py b/src/common/connection_handlers_events.py index 8983c0683..c09e60cb0 100644 --- a/src/common/connection_handlers_events.py +++ b/src/common/connection_handlers_events.py @@ -36,8 +36,9 @@ import logging log = logging.getLogger('gajim.c.connection_handlers_events') class HelperEvent: - def get_jid_resource(self): - if hasattr(self, 'id_') and self.id_ in self.conn.groupchat_jids: + def get_jid_resource(self, check_fake_jid=False): + if check_fake_jid and hasattr(self, 'id_') and \ + self.id_ in self.conn.groupchat_jids: self.fjid = self.conn.groupchat_jids[self.id_] del self.conn.groupchat_jids[self.id_] else: @@ -81,7 +82,7 @@ class LastResultReceivedEvent(nec.NetworkIncomingEvent, HelperEvent): def generate(self): self.get_id() - self.get_jid_resource() + self.get_jid_resource(check_fake_jid=True) if self.id_ in self.conn.last_ids: self.conn.last_ids.remove(self.id_) @@ -109,7 +110,7 @@ class VersionResultReceivedEvent(nec.NetworkIncomingEvent, HelperEvent): def generate(self): self.get_id() - self.get_jid_resource() + self.get_jid_resource(check_fake_jid=True) if self.id_ in self.conn.version_ids: self.conn.version_ids.remove(self.id_) @@ -135,7 +136,7 @@ class TimeResultReceivedEvent(nec.NetworkIncomingEvent, HelperEvent): def generate(self): self.get_id() - self.get_jid_resource() + self.get_jid_resource(check_fake_jid=True) if self.id_ in self.conn.entity_time_ids: self.conn.entity_time_ids.remove(self.id_) @@ -592,7 +593,7 @@ class IqErrorReceivedEvent(nec.NetworkIncomingEvent, HelperEvent): def generate(self): self.get_id() - self.get_jid_resource() + self.get_jid_resource(check_fake_jid=True) self.errmsg = self.stanza.getErrorMsg() self.errcode = self.stanza.getErrorCode() return True