diff options
author | Lance Stout <lancestout@gmail.com> | 2012-06-19 16:21:34 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2012-06-19 16:21:34 -0700 |
commit | 019a4b20ae5284ec07d4ecc5e5136be5012e88bd (patch) | |
tree | 589e183ae20a96e5c0996023b6d227393bd4ee35 /sleekxmpp/stanza/error.py | |
parent | 433ee08687e5a0df7e0d1388f194d246f5aaee05 (diff) | |
download | slixmpp-019a4b20ae5284ec07d4ecc5e5136be5012e88bd.tar.gz slixmpp-019a4b20ae5284ec07d4ecc5e5136be5012e88bd.tar.bz2 slixmpp-019a4b20ae5284ec07d4ecc5e5136be5012e88bd.tar.xz slixmpp-019a4b20ae5284ec07d4ecc5e5136be5012e88bd.zip |
Fix assigning values to error stanzas.
The new data interfaces were deleting the actual error conditions if
they were set afterward with falsy data.
Diffstat (limited to 'sleekxmpp/stanza/error.py')
-rw-r--r-- | sleekxmpp/stanza/error.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sleekxmpp/stanza/error.py b/sleekxmpp/stanza/error.py index 8d9266bd..60bc65bc 100644 --- a/sleekxmpp/stanza/error.py +++ b/sleekxmpp/stanza/error.py @@ -143,15 +143,19 @@ class Error(ElementBase): return self._get_sub_text('{%s}redirect' % self.condition_ns, '') def set_gone(self, value): - del self['condition'] if value: + del self['condition'] return self._set_sub_text('{%s}gone' % self.condition_ns, value) + elif self['condition'] == 'gone': + del self['condition'] def set_redirect(self, value): - del self['condition'] if value: + del self['condition'] ns = self.condition_ns return self._set_sub_text('{%s}redirect' % ns, value) + elif self['condition'] == 'redirect': + del self['condition'] def del_gone(self): self._del_sub('{%s}gone' % self.condition_ns) |