fixed status change issue

This commit is contained in:
Nathan Fritz 2010-01-27 19:37:26 -08:00
parent 3dbd496de8
commit 167bf70e0b

View file

@ -252,7 +252,7 @@ class basexmpp(object):
if presence['type'] in ('subscribe', 'subscribed', 'unsubscribe', 'unsubscribed'): if presence['type'] in ('subscribe', 'subscribed', 'unsubscribe', 'unsubscribed'):
self.event('changed_subscription', presence) self.event('changed_subscription', presence)
return return
elif not presence['type'] in ('available', 'unavailable'): elif not presence['type'] in ('available', 'unavailable') and not presence['type'] in presence.showtypes:
return return
jid = presence['from'].bare jid = presence['from'].bare
resource = presence['from'].resource resource = presence['from'].resource
@ -280,7 +280,7 @@ class basexmpp(object):
del self.roster[jid]['presence'][resource] del self.roster[jid]['presence'][resource]
else: else:
del self.roster[jid] del self.roster[jid]
elif oldroster != self.roster.get(jid, {'presence': {}})['presence'].get(resource, {}) and show != 'unavailable': elif oldroster != self.roster.get(jid, {'presence': {}})['presence'].get(resource, {}):
self.event("changed_status", presence) self.event("changed_status", presence)
name = '' name = ''
if name: if name: