summaryrefslogtreecommitdiff
path: root/slixmpp/plugins/xep_0425/stanza.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2020-12-02 20:25:50 +0100
committermathieui <mathieui@mathieui.net>2020-12-04 19:42:23 +0100
commit41dea80d94e319b0df14d5a271ddb2cc06b56876 (patch)
tree7cbe11feee4587e1e0085a82c3b7120175185de8 /slixmpp/plugins/xep_0425/stanza.py
parentc4ca15a040d45ba27c4f546293e83ff6143b4dfc (diff)
downloadslixmpp-41dea80d94e319b0df14d5a271ddb2cc06b56876.tar.gz
slixmpp-41dea80d94e319b0df14d5a271ddb2cc06b56876.tar.bz2
slixmpp-41dea80d94e319b0df14d5a271ddb2cc06b56876.tar.xz
slixmpp-41dea80d94e319b0df14d5a271ddb2cc06b56876.zip
XEP-0425: Message Moderation
Diffstat (limited to 'slixmpp/plugins/xep_0425/stanza.py')
-rw-r--r--slixmpp/plugins/xep_0425/stanza.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/slixmpp/plugins/xep_0425/stanza.py b/slixmpp/plugins/xep_0425/stanza.py
new file mode 100644
index 00000000..9b756953
--- /dev/null
+++ b/slixmpp/plugins/xep_0425/stanza.py
@@ -0,0 +1,46 @@
+"""
+ 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, Iq
+from slixmpp.xmlstream import (
+ ElementBase,
+ register_stanza_plugin,
+)
+from slixmpp.plugins.xep_0422.stanza import ApplyTo
+from slixmpp.plugins.xep_0421.stanza import OccupantId
+from slixmpp.plugins.xep_0424.stanza import Retract, Retracted
+
+
+NS = 'urn:xmpp:message-moderate:0'
+
+
+class Moderate(ElementBase):
+ namespace = NS
+ name = 'moderate'
+ plugin_attrib = 'moderate'
+ interfaces = {'reason'}
+ sub_interfaces = {'reason'}
+
+
+class Moderated(ElementBase):
+ namespace = NS
+ name = 'moderated'
+ plugin_attrib = 'moderated'
+ interfaces = {'reason', 'by'}
+ sub_interfaces = {'reason'}
+
+
+def register_plugins():
+ register_stanza_plugin(Iq, ApplyTo)
+ register_stanza_plugin(ApplyTo, Moderate)
+ register_stanza_plugin(Moderate, Retract)
+
+ register_stanza_plugin(Message, Moderated)
+ register_stanza_plugin(ApplyTo, Moderated)
+ register_stanza_plugin(Moderated, Retracted)
+ register_stanza_plugin(Moderated, OccupantId)