summaryrefslogtreecommitdiff
path: root/slixmpp/plugins/xep_0424/stanza.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2020-12-02 20:10:25 +0100
committermathieui <mathieui@mathieui.net>2020-12-04 19:14:32 +0100
commitc4ca15a040d45ba27c4f546293e83ff6143b4dfc (patch)
tree3251563d13a84ef248636966ced70ae285119bfc /slixmpp/plugins/xep_0424/stanza.py
parent54d556280ae5003eb56eeb419dfcb0b906506938 (diff)
downloadslixmpp-c4ca15a040d45ba27c4f546293e83ff6143b4dfc.tar.gz
slixmpp-c4ca15a040d45ba27c4f546293e83ff6143b4dfc.tar.bz2
slixmpp-c4ca15a040d45ba27c4f546293e83ff6143b4dfc.tar.xz
slixmpp-c4ca15a040d45ba27c4f546293e83ff6143b4dfc.zip
XEP-0424: Message Retraction
Diffstat (limited to 'slixmpp/plugins/xep_0424/stanza.py')
-rw-r--r--slixmpp/plugins/xep_0424/stanza.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/slixmpp/plugins/xep_0424/stanza.py b/slixmpp/plugins/xep_0424/stanza.py
new file mode 100644
index 00000000..c55af08c
--- /dev/null
+++ b/slixmpp/plugins/xep_0424/stanza.py
@@ -0,0 +1,38 @@
+"""
+ 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,
+)
+from slixmpp.plugins.xep_0422.stanza import ApplyTo
+from slixmpp.plugins.xep_0359 import OriginID
+
+
+NS = 'urn:xmpp:message-retract:0'
+
+
+class Retract(ElementBase):
+ namespace = NS
+ name = 'retract'
+ plugin_attrib = 'retract'
+
+
+class Retracted(ElementBase):
+ namespace = NS
+ name = 'retracted'
+ plugin_attrib = 'retracted'
+ interfaces = {'stamp'}
+
+
+def register_plugins():
+ register_stanza_plugin(ApplyTo, Retract)
+ register_stanza_plugin(Message, Retracted)
+
+ register_stanza_plugin(Retracted, OriginID)