Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'nbxmpp/structs.py')
-rw-r--r--nbxmpp/structs.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/nbxmpp/structs.py b/nbxmpp/structs.py
index 80e5831..29b48d9 100644
--- a/nbxmpp/structs.py
+++ b/nbxmpp/structs.py
@@ -284,6 +284,13 @@ class CorrectionData(NamedTuple):
id: str
+class ModerationData(NamedTuple):
+ stanza_id: str
+ moderator_jid: str
+ reason: Optional[str] = None
+ timestamp: Optional[str] = None
+
+
class DiscoItems(NamedTuple):
jid: JID
node: str
@@ -469,6 +476,10 @@ class DiscoInfo(NamedTuple):
return Namespace.HTTPUPLOAD_0 in self.features
@property
+ def has_message_moderation(self) -> bool:
+ return Namespace.MESSAGE_MODERATE in self.features
+
+ @property
def is_muc(self) -> bool:
for identity in self.identities:
if identity.category == 'conference':
@@ -960,6 +971,7 @@ class MessageProperties:
receipt: Optional[ReceiptData] = None
oob: Optional[OOBData] = None
correction: Optional[CorrectionData] = None
+ moderation: Optional[ModerationData] = None
attention: bool = False
forms = None
xhtml: Optional[str] = None
@@ -1070,6 +1082,10 @@ class MessageProperties:
return self.correction is not None
@property
+ def is_moderation(self) -> bool:
+ return self.moderation is not None
+
+ @property
def has_attention(self) -> bool:
return self.attention