diff options
Diffstat (limited to 'slixmpp/plugins/protoxep_reactions/stanza.py')
-rw-r--r-- | slixmpp/plugins/protoxep_reactions/stanza.py | 31 |
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) |