blob: 566b1d0937b6f33002cbcf26b21df5a4b4be7985 (
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
"""
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, Retract)
register_stanza_plugin(Moderated, Retracted)
register_stanza_plugin(Moderated, OccupantId)
|