summaryrefslogtreecommitdiff
path: root/slixmpp/plugins/xep_0332/stanza/data.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2015-10-02 19:07:45 +0200
committermathieui <mathieui@mathieui.net>2015-10-02 19:07:45 +0200
commitada9444bf84bd238238c4d22561f69184dd22cdd (patch)
treeceb4f86446b4129ec22cb348f1cb1bd7a151e2da /slixmpp/plugins/xep_0332/stanza/data.py
parent1100ff1febf7e605e03fd9565bdac5fdaa3bf1e0 (diff)
parentacc52fd935b7e74919ad748f3a630596f66c62af (diff)
downloadslixmpp-ada9444bf84bd238238c4d22561f69184dd22cdd.tar.gz
slixmpp-ada9444bf84bd238238c4d22561f69184dd22cdd.tar.bz2
slixmpp-ada9444bf84bd238238c4d22561f69184dd22cdd.tar.xz
slixmpp-ada9444bf84bd238238c4d22561f69184dd22cdd.zip
Merge branch 'sleek-merge'
Diffstat (limited to 'slixmpp/plugins/xep_0332/stanza/data.py')
-rw-r--r--slixmpp/plugins/xep_0332/stanza/data.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/slixmpp/plugins/xep_0332/stanza/data.py b/slixmpp/plugins/xep_0332/stanza/data.py
new file mode 100644
index 00000000..a19c94f5
--- /dev/null
+++ b/slixmpp/plugins/xep_0332/stanza/data.py
@@ -0,0 +1,30 @@
+"""
+ Slixmpp: The Slick XMPP Library
+ Implementation of HTTP over XMPP transport
+ http://xmpp.org/extensions/xep-0332.html
+ Copyright (C) 2015 Riptide IO, sangeeth@riptideio.com
+ This file is part of slixmpp.
+
+ See the file LICENSE for copying permission.
+"""
+
+from slixmpp.xmlstream import ElementBase
+
+
+class HTTPData(ElementBase):
+ """
+ The data element.
+ """
+ name = 'data'
+ namespace = 'urn:xmpp:http'
+ interfaces = set(['data'])
+ plugin_attrib = 'data'
+ is_extension = True
+
+ def get_data(self, encoding='text'):
+ data = self._get_sub_text(encoding, None)
+ return str(data) if data is not None else data
+
+ def set_data(self, data, encoding='text'):
+ self._set_sub_text(encoding, text=data)
+