summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@netflint.net>2009-11-11 03:14:16 +0000
committerNathan Fritz <fritzy@netflint.net>2009-11-11 03:14:16 +0000
commit6be17ebbe27c17da01abe4fe1134e070c6ee632f (patch)
tree404b8323f9d0b0e5d24122e71a69e443aa8eff3c
parent1fa1f7dcc63ac6312cc5aafde191aad1f026deb9 (diff)
downloadslixmpp-6be17ebbe27c17da01abe4fe1134e070c6ee632f.tar.gz
slixmpp-6be17ebbe27c17da01abe4fe1134e070c6ee632f.tar.bz2
slixmpp-6be17ebbe27c17da01abe4fe1134e070c6ee632f.tar.xz
slixmpp-6be17ebbe27c17da01abe4fe1134e070c6ee632f.zip
* clean up offline contacts
-rw-r--r--sleekxmpp/basexmpp.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py
index 20958679..07715e0c 100644
--- a/sleekxmpp/basexmpp.py
+++ b/sleekxmpp/basexmpp.py
@@ -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 = ''