summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-08-07 11:05:28 +0200
committermathieui <mathieui@mathieui.net>2012-08-07 11:05:28 +0200
commite8dce570eac86cb9b888a61776ca5c858c03a1aa (patch)
tree97853826c89cbf17d41f0e413bb68b216654886d /src/core.py
parent7a485ef4d0d74313bff8c9c7b2ee2dcb5c4a75e9 (diff)
downloadpoezio-e8dce570eac86cb9b888a61776ca5c858c03a1aa.tar.gz
poezio-e8dce570eac86cb9b888a61776ca5c858c03a1aa.tar.bz2
poezio-e8dce570eac86cb9b888a61776ca5c858c03a1aa.tar.xz
poezio-e8dce570eac86cb9b888a61776ca5c858c03a1aa.zip
Take care of the race condition "node@groupchat_server is now online/offline"
- get rid of the ugly blacklist thing that didn’t work sometimes
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core.py b/src/core.py
index 5368ff93..519e82a3 100644
--- a/src/core.py
+++ b/src/core.py
@@ -2409,6 +2409,8 @@ class Core(object):
### Presence-related handlers ###
def on_presence(self, presence):
+ if presence.match('presence/muc') or presence.xml.find('{http://jabber.org/protocol/muc#user}x'):
+ return
jid = presence['from']
contact = roster[jid.bare]
if contact is None:
@@ -2425,20 +2427,25 @@ class Core(object):
"""
A JID got offline
"""
+ if presence.match('presence/muc') or presence.xml.find('{http://jabber.org/protocol/muc#user}x'):
+ return
jid = presence['from']
logger.log_roster_change(jid.bare, 'got offline')
# If a resource got offline, display the message in the conversation with this
# precise resource.
if jid.resource:
self.add_information_message_to_conversation_tab(jid.full, '\x195}%s is \x191}offline' % (jid.full))
- if jid.server in roster.blacklist:
- return
self.add_information_message_to_conversation_tab(jid.bare, '\x195}%s is \x191}offline' % (jid.bare))
self.information('\x193}%s \x195}is \x191}offline' % (jid.bare), 'Roster')
if isinstance(self.current_tab(), tabs.RosterInfoTab):
self.refresh_window()
def on_got_online(self, presence):
+ """
+ A JID got online
+ """
+ if presence.match('presence/muc') or presence.xml.find('{http://jabber.org/protocol/muc#user}x'):
+ return
jid = presence['from']
contact = roster[jid.bare]
if contact is None:
@@ -2700,7 +2707,6 @@ class Core(object):
-
class KeyDict(dict):
"""
A dict, with a wrapper for get() that will return a custom value