diff options
author | Lance Stout <lancestout@gmail.com> | 2012-06-16 14:12:13 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2012-06-18 22:19:04 -0700 |
commit | 8da387a38aa90069cdcb44df2a36ccea303b62c8 (patch) | |
tree | a7f67003a229d8c8819838082f93d2beb6271d0a /sleekxmpp/stanza/stream_error.py | |
parent | ff6fc44215c07ef112c59dec32ed753cd30a460c (diff) | |
download | slixmpp-8da387a38aa90069cdcb44df2a36ccea303b62c8.tar.gz slixmpp-8da387a38aa90069cdcb44df2a36ccea303b62c8.tar.bz2 slixmpp-8da387a38aa90069cdcb44df2a36ccea303b62c8.tar.xz slixmpp-8da387a38aa90069cdcb44df2a36ccea303b62c8.zip |
Add support for error conditions that include data.
Diffstat (limited to 'sleekxmpp/stanza/stream_error.py')
-rw-r--r-- | sleekxmpp/stanza/stream_error.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sleekxmpp/stanza/stream_error.py b/sleekxmpp/stanza/stream_error.py index 5a6dac96..bf77d932 100644 --- a/sleekxmpp/stanza/stream_error.py +++ b/sleekxmpp/stanza/stream_error.py @@ -54,7 +54,7 @@ class StreamError(Error, StanzaBase): """ namespace = 'http://etherx.jabber.org/streams' - interfaces = set(('condition', 'text')) + interfaces = set(('condition', 'text', 'see_other_host')) conditions = set(( 'bad-format', 'bad-namespace-prefix', 'conflict', 'connection-timeout', 'host-gone', 'host-unknown', @@ -66,3 +66,17 @@ class StreamError(Error, StanzaBase): 'unsupported-feature', 'unsupported-stanza-type', 'unsupported-version')) condition_ns = 'urn:ietf:params:xml:ns:xmpp-streams' + + def get_see_other_host(self): + ns = self.condition_ns + return self._get_sub_text('{%s}see-other-host' % ns, '') + + def set_see_other_host(self, value): + del self['condition'] + if value: + ns = self.condition_ns + return self._set_sub_text('{%s}see-other-host' % ns, value) + + def del_see_other_host(self): + self._del_sub('{%s}see-other-host' % self.condition_ns) + |