summaryrefslogtreecommitdiff
path: root/sleekxmpp/basexmpp.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-02-02 09:13:22 -0500
committerLance Stout <lancestout@gmail.com>2011-02-02 09:13:22 -0500
commitde6170a13de2dbb3cbcfbf4a74b749f20b0cf061 (patch)
treeb60043234119a3d215e0eca65913dd038167b551 /sleekxmpp/basexmpp.py
parent65931bb384aada922c5287a3ad3cc62d04d6e676 (diff)
parent8dbe6f65462ec9b1a0506a00316415996f4d53d8 (diff)
downloadslixmpp-de6170a13de2dbb3cbcfbf4a74b749f20b0cf061.tar.gz
slixmpp-de6170a13de2dbb3cbcfbf4a74b749f20b0cf061.tar.bz2
slixmpp-de6170a13de2dbb3cbcfbf4a74b749f20b0cf061.tar.xz
slixmpp-de6170a13de2dbb3cbcfbf4a74b749f20b0cf061.zip
Merge branch 'develop' into roster
Conflicts: sleekxmpp/basexmpp.py
Diffstat (limited to 'sleekxmpp/basexmpp.py')
-rw-r--r--sleekxmpp/basexmpp.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py
index 699424ca..bd953afe 100644
--- a/sleekxmpp/basexmpp.py
+++ b/sleekxmpp/basexmpp.py
@@ -16,7 +16,7 @@ import sleekxmpp
from sleekxmpp import plugins
import sleekxmpp.roster as roster
-from sleekxmpp.stanza import Message, Presence, Iq, Error
+from sleekxmpp.stanza import Message, Presence, Iq, Error, StreamError
from sleekxmpp.stanza.roster import Roster
from sleekxmpp.stanza.nick import Nick
from sleekxmpp.stanza.htmlim import HTMLIM
@@ -133,6 +133,10 @@ class BaseXMPP(XMLStream):
Callback('Presence',
MatchXPath("{%s}presence" % self.default_ns),
self._handle_presence))
+ self.register_handler(
+ Callback('Stream Error',
+ MatchXPath("{%s}error" % self.stream_ns),
+ self._handle_stream_error))
self.add_event_handler('disconnected',
self._handle_disconnected)
@@ -165,6 +169,7 @@ class BaseXMPP(XMLStream):
self.register_stanza(Message)
self.register_stanza(Iq)
self.register_stanza(Presence)
+ self.register_stanza(StreamError)
# Initialize a few default stanza plugins.
register_stanza_plugin(Iq, Roster)
@@ -606,6 +611,9 @@ class BaseXMPP(XMLStream):
"""When disconnected, reset the roster"""
self.roster = {}
+ def _handle_stream_error(self, error):
+ self.event('stream_error', error)
+
def _handle_message(self, msg):
"""Process incoming message stanzas."""
self.event('message', msg)