summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0047/stanza.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-02-02 19:19:50 +0100
committerLance Stout <lancestout@gmail.com>2012-02-02 19:19:50 +0100
commit4665c5cf1acf22bd3988682c2942ce0c50d897c4 (patch)
tree6f8c052fbc529e5302878d811d4c969d2d5fc74d /sleekxmpp/plugins/xep_0047/stanza.py
parentbd52a5e6c12237e1ab4ceaf0d5933f3e5109800e (diff)
downloadslixmpp-4665c5cf1acf22bd3988682c2942ce0c50d897c4.tar.gz
slixmpp-4665c5cf1acf22bd3988682c2942ce0c50d897c4.tar.bz2
slixmpp-4665c5cf1acf22bd3988682c2942ce0c50d897c4.tar.xz
slixmpp-4665c5cf1acf22bd3988682c2942ce0c50d897c4.zip
Fix data stanza based on test results.
Diffstat (limited to 'sleekxmpp/plugins/xep_0047/stanza.py')
-rw-r--r--sleekxmpp/plugins/xep_0047/stanza.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sleekxmpp/plugins/xep_0047/stanza.py b/sleekxmpp/plugins/xep_0047/stanza.py
index e3b55511..2e4f8ccc 100644
--- a/sleekxmpp/plugins/xep_0047/stanza.py
+++ b/sleekxmpp/plugins/xep_0047/stanza.py
@@ -46,14 +46,17 @@ class Data(ElementBase):
self._set_attr('seq', str(value))
def get_data(self):
- b64_data = self._get_sub_text('data', '')
+ b64_data = self.xml.text
if VALID_B64.match(b64_data).group() == b64_data:
return from_b64(b64_data)
else:
raise XMPPError('not-acceptable')
def set_data(self, value):
- self._set_sub_text('data', to_b64(value))
+ self.xml.text = to_64(value)
+
+ def del_data(self):
+ self.xml.text = ''
class Close(ElementBase):