summaryrefslogtreecommitdiff
path: root/slixmpp/plugins/protoxep_reactions/stanza.py
blob: 45414a37a614bf7be1c42706ef2dacda92383756 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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)