summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0332/stanza/data.py
diff options
context:
space:
mode:
authorMike Taylor <bear42@gmail.com>2015-04-28 22:44:27 -0400
committerMike Taylor <bear42@gmail.com>2015-04-28 22:44:27 -0400
commit192b7e0349429839261eb4d1d42d8f75933dc0c2 (patch)
treeecb5905d19a563b4e6fe864afd0122321bf7cea1 /sleekxmpp/plugins/xep_0332/stanza/data.py
parent842157a6cc25d9e85e6e31b3cf3349ba83ece101 (diff)
parent80b60fc0483b21c8d5829b61cabbf9b46aa2c2fb (diff)
downloadslixmpp-192b7e0349429839261eb4d1d42d8f75933dc0c2.tar.gz
slixmpp-192b7e0349429839261eb4d1d42d8f75933dc0c2.tar.bz2
slixmpp-192b7e0349429839261eb4d1d42d8f75933dc0c2.tar.xz
slixmpp-192b7e0349429839261eb4d1d42d8f75933dc0c2.zip
Merge pull request #345 from sangeeths/xep_0332
XEP-0332: HTTP over XMPP transport
Diffstat (limited to 'sleekxmpp/plugins/xep_0332/stanza/data.py')
-rw-r--r--sleekxmpp/plugins/xep_0332/stanza/data.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/sleekxmpp/plugins/xep_0332/stanza/data.py b/sleekxmpp/plugins/xep_0332/stanza/data.py
new file mode 100644
index 00000000..9a08426b
--- /dev/null
+++ b/sleekxmpp/plugins/xep_0332/stanza/data.py
@@ -0,0 +1,30 @@
+"""
+ SleekXMPP: The Sleek 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 SleekXMPP.
+
+ See the file LICENSE for copying permission.
+"""
+
+from sleekxmpp.xmlstream import ElementBase
+
+
+class Data(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)
+