mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-24 03:00:15 +00:00
when disconnected, reset the roster
This commit is contained in:
parent
77eab6544f
commit
ce69213a1e
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue