summaryrefslogtreecommitdiff
path: root/slixmpp/plugins/protoxep_reactions/stanza.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2019-07-13 19:32:37 +0200
committermathieui <mathieui@mathieui.net>2019-07-13 19:44:32 +0200
commitb50bfb2f34a3ace3a70b1647f54ad6a0e761acf7 (patch)
tree9f97033fc4e70772990ceb3f4d22dc32d7ec4544 /slixmpp/plugins/protoxep_reactions/stanza.py
parentb29bb30eb7bb46ce2b945efed55a265324e05383 (diff)
downloadslixmpp-b50bfb2f34a3ace3a70b1647f54ad6a0e761acf7.tar.gz
slixmpp-b50bfb2f34a3ace3a70b1647f54ad6a0e761acf7.tar.bz2
slixmpp-b50bfb2f34a3ace3a70b1647f54ad6a0e761acf7.tar.xz
slixmpp-b50bfb2f34a3ace3a70b1647f54ad6a0e761acf7.zip
Initial commit for reactions protoxep
Diffstat (limited to 'slixmpp/plugins/protoxep_reactions/stanza.py')
-rw-r--r--slixmpp/plugins/protoxep_reactions/stanza.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/slixmpp/plugins/protoxep_reactions/stanza.py b/slixmpp/plugins/protoxep_reactions/stanza.py
new file mode 100644
index 00000000..45414a37
--- /dev/null
+++ b/slixmpp/plugins/protoxep_reactions/stanza.py
@@ -0,0 +1,31 @@
+"""
+ Slixmpp: The Slick XMPP Library
+ Copyright (C) 2019 Mathieu Pasquet
+ This file is part of Slixmpp.
+
+ See the file LICENSE for copying permission.
+"""
+
+from slixmpp.xmlstream import ElementBase, register_stanza_plugin
+
+
+class Reactions(ElementBase):
+ name = 'reactions'
+ plugin_attrib = 'reactions'
+ namespace = 'urn:xmpp:reactions:0'
+ interfaces = {'to'}
+
+
+class Reaction(ElementBase):
+ name = 'reaction'
+ namespace = 'urn:xmpp:reactions:0'
+ interfaces = {'value'}
+
+ def get_value(self) -> str:
+ return self.xml.text
+
+ def set_value(self, value: str):
+ self.xml.text = value
+
+
+register_stanza_plugin(Reactions, Reaction, iterable=True)