diff options
author | mathieui <mathieui@mathieui.net> | 2020-12-02 20:56:41 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2020-12-04 19:42:23 +0100 |
commit | 2c523d1a3b6a97b78b5ee4d688f33fccd71eb83c (patch) | |
tree | 90704c266264dcf765fd30aa5343c1cb63d07983 /slixmpp/plugins/xep_0439/stanza.py | |
parent | 41dea80d94e319b0df14d5a271ddb2cc06b56876 (diff) | |
download | slixmpp-2c523d1a3b6a97b78b5ee4d688f33fccd71eb83c.tar.gz slixmpp-2c523d1a3b6a97b78b5ee4d688f33fccd71eb83c.tar.bz2 slixmpp-2c523d1a3b6a97b78b5ee4d688f33fccd71eb83c.tar.xz slixmpp-2c523d1a3b6a97b78b5ee4d688f33fccd71eb83c.zip |
XEP-0439: Quick Response
Diffstat (limited to 'slixmpp/plugins/xep_0439/stanza.py')
-rw-r--r-- | slixmpp/plugins/xep_0439/stanza.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/slixmpp/plugins/xep_0439/stanza.py b/slixmpp/plugins/xep_0439/stanza.py new file mode 100644 index 00000000..e00e1f27 --- /dev/null +++ b/slixmpp/plugins/xep_0439/stanza.py @@ -0,0 +1,43 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permissio +""" + +from slixmpp.stanza import Message +from slixmpp.xmlstream import ( + ElementBase, + register_stanza_plugin, +) + + +NS = 'urn:xmpp:tmp:quick-response' + + +class Response(ElementBase): + namespace = NS + name = 'response' + plugin_attrib = 'response' + interfaces = {'value', 'label'} + + +class Action(ElementBase): + namespace = NS + name = 'action' + plugin_attrib = 'action' + interfaces = {'id', 'label'} + + +class ActionSelected(ElementBase): + namespace = NS + name = 'action-selected' + plugin_attrib = 'action_selected' + interfaces = {'id'} + + +def register_plugins(): + register_stanza_plugin(Message, Action, iterable=True) + register_stanza_plugin(Message, ActionSelected) + register_stanza_plugin(Message, Response, iterable=True) |