* clean up offline contacts

This commit is contained in:
Nathan Fritz 2009-11-11 03:14:16 +00:00
parent 1fa1f7dcc6
commit 6be17ebbe2

View file

@ -419,6 +419,10 @@ class basexmpp(object):
self.event("got_online", eventdata)
elif not wasoffline and show == 'unavailable':
self.event("got_offline", eventdata)
if len(self.roster[jid]['presence']) > 1:
del self.roster[jid]['presence'][resource]
else:
del self.roster[jid]
elif oldroster != self.roster.get(jid, {'presence': {}})['presence'].get(resource, {}) and show != 'unavailable':
self.event("changed_status", eventdata)
name = ''