diff options
author | Nathan Fritz <nathan@andyet.net> | 2010-10-20 19:33:40 -0700 |
---|---|---|
committer | Nathan Fritz <nathan@andyet.net> | 2010-10-20 19:33:40 -0700 |
commit | ce69213a1ec1c6ed281c38ee6df39a4bc9794356 (patch) | |
tree | ac5cb459c1923239ab882bc36ba7b6128e2b09a3 /sleekxmpp/basexmpp.py | |
parent | 77eab6544f1f44f2450ecca4e7588dd60e484631 (diff) | |
download | slixmpp-ce69213a1ec1c6ed281c38ee6df39a4bc9794356.tar.gz slixmpp-ce69213a1ec1c6ed281c38ee6df39a4bc9794356.tar.bz2 slixmpp-ce69213a1ec1c6ed281c38ee6df39a4bc9794356.tar.xz slixmpp-ce69213a1ec1c6ed281c38ee6df39a4bc9794356.zip |
when disconnected, reset the roster
Diffstat (limited to 'sleekxmpp/basexmpp.py')
-rw-r--r-- | sleekxmpp/basexmpp.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py index 8197f6a7..802f44cc 100644 --- a/sleekxmpp/basexmpp.py +++ b/sleekxmpp/basexmpp.py @@ -135,6 +135,8 @@ class BaseXMPP(XMLStream): self.add_event_handler('presence_subscribe', self._handle_subscribe) + self.add_event_handler('disconnected', + self._handle_disconnected) # Set up the XML stream with XMPP's root stanzas. self.registerStanza(Message) @@ -518,6 +520,10 @@ class BaseXMPP(XMLStream): def getjidbare(self, fulljid): return fulljid.split('/', 1)[0] + def _handle_disconnected(self, event): + """When disconnected, reset the roster""" + self.roster = {} + def _handle_message(self, msg): """Process incoming message stanzas.""" self.event('message', msg) |