check real JID <-> fake JID correspondance only when needed.
This commit is contained in:
parent
eaaa2634e3
commit
278ba237f9
|
@ -36,8 +36,9 @@ import logging
|
||||||
log = logging.getLogger('gajim.c.connection_handlers_events')
|
log = logging.getLogger('gajim.c.connection_handlers_events')
|
||||||
|
|
||||||
class HelperEvent:
|
class HelperEvent:
|
||||||
def get_jid_resource(self):
|
def get_jid_resource(self, check_fake_jid=False):
|
||||||
if hasattr(self, 'id_') and self.id_ in self.conn.groupchat_jids:
|
if check_fake_jid and hasattr(self, 'id_') and \
|
||||||
|
self.id_ in self.conn.groupchat_jids:
|
||||||
self.fjid = self.conn.groupchat_jids[self.id_]
|
self.fjid = self.conn.groupchat_jids[self.id_]
|
||||||
del self.conn.groupchat_jids[self.id_]
|
del self.conn.groupchat_jids[self.id_]
|
||||||
else:
|
else:
|
||||||
|
@ -81,7 +82,7 @@ class LastResultReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
|
||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
self.get_id()
|
self.get_id()
|
||||||
self.get_jid_resource()
|
self.get_jid_resource(check_fake_jid=True)
|
||||||
if self.id_ in self.conn.last_ids:
|
if self.id_ in self.conn.last_ids:
|
||||||
self.conn.last_ids.remove(self.id_)
|
self.conn.last_ids.remove(self.id_)
|
||||||
|
|
||||||
|
@ -109,7 +110,7 @@ class VersionResultReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
|
||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
self.get_id()
|
self.get_id()
|
||||||
self.get_jid_resource()
|
self.get_jid_resource(check_fake_jid=True)
|
||||||
if self.id_ in self.conn.version_ids:
|
if self.id_ in self.conn.version_ids:
|
||||||
self.conn.version_ids.remove(self.id_)
|
self.conn.version_ids.remove(self.id_)
|
||||||
|
|
||||||
|
@ -135,7 +136,7 @@ class TimeResultReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
|
||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
self.get_id()
|
self.get_id()
|
||||||
self.get_jid_resource()
|
self.get_jid_resource(check_fake_jid=True)
|
||||||
if self.id_ in self.conn.entity_time_ids:
|
if self.id_ in self.conn.entity_time_ids:
|
||||||
self.conn.entity_time_ids.remove(self.id_)
|
self.conn.entity_time_ids.remove(self.id_)
|
||||||
|
|
||||||
|
@ -592,7 +593,7 @@ class IqErrorReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
|
||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
self.get_id()
|
self.get_id()
|
||||||
self.get_jid_resource()
|
self.get_jid_resource(check_fake_jid=True)
|
||||||
self.errmsg = self.stanza.getErrorMsg()
|
self.errmsg = self.stanza.getErrorMsg()
|
||||||
self.errcode = self.stanza.getErrorCode()
|
self.errcode = self.stanza.getErrorCode()
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue