diff options
-rw-r--r-- | slixmpp/plugins/__init__.py | 1 | ||||
-rw-r--r-- | slixmpp/plugins/xep_0428/__init__.py | 13 | ||||
-rw-r--r-- | slixmpp/plugins/xep_0428/fallback.py | 22 | ||||
-rw-r--r-- | slixmpp/plugins/xep_0428/stanza.py | 26 |
4 files changed, 62 insertions, 0 deletions
diff --git a/slixmpp/plugins/__init__.py b/slixmpp/plugins/__init__.py index 758cccd1..0bc62676 100644 --- a/slixmpp/plugins/__init__.py +++ b/slixmpp/plugins/__init__.py @@ -95,5 +95,6 @@ __all__ = [ 'xep_0405', # MIX-PAM 'xep_0421', # Anonymous unique occupant identifiers for MUCs 'xep_0422', # Message Fastening + 'xep_0428', # Message Fallback 'xep_0444', # Message Reactions ] diff --git a/slixmpp/plugins/xep_0428/__init__.py b/slixmpp/plugins/xep_0428/__init__.py new file mode 100644 index 00000000..864f4ed3 --- /dev/null +++ b/slixmpp/plugins/xep_0428/__init__.py @@ -0,0 +1,13 @@ +""" + 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 permission. +""" + +from slixmpp.plugins.base import register_plugin +from slixmpp.plugins.xep_0428.stanza import * +from slixmpp.plugins.xep_0428.fallback import XEP_0428 + +register_plugin(XEP_0428) diff --git a/slixmpp/plugins/xep_0428/fallback.py b/slixmpp/plugins/xep_0428/fallback.py new file mode 100644 index 00000000..61e913e3 --- /dev/null +++ b/slixmpp/plugins/xep_0428/fallback.py @@ -0,0 +1,22 @@ +""" + 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 permission. +""" +from slixmpp.plugins import BasePlugin +from slixmpp.plugins.xep_0428 import stanza + + +class XEP_0428(BasePlugin): + '''XEP-0428: Fallback Indication''' + + name = 'xep_0428' + description = 'Fallback Indication' + dependencies = set() + stanza = stanza + namespace = stanza.NS + + def plugin_init(self) -> None: + stanza.register_plugins() diff --git a/slixmpp/plugins/xep_0428/stanza.py b/slixmpp/plugins/xep_0428/stanza.py new file mode 100644 index 00000000..41df80d0 --- /dev/null +++ b/slixmpp/plugins/xep_0428/stanza.py @@ -0,0 +1,26 @@ +""" + 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:fallback:0' + + +class Fallback(ElementBase): + namespace = NS + name = 'fallback' + plugin_attrib = 'fallback' + + +def register_plugins(): + register_stanza_plugin(Message, Fallback) |