summaryrefslogtreecommitdiff
path: root/slixmpp/plugins/xep_0045/stanza.py
diff options
context:
space:
mode:
Diffstat (limited to 'slixmpp/plugins/xep_0045/stanza.py')
-rw-r--r--slixmpp/plugins/xep_0045/stanza.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/slixmpp/plugins/xep_0045/stanza.py b/slixmpp/plugins/xep_0045/stanza.py
index 71eb3fb5..6c3d2244 100644
--- a/slixmpp/plugins/xep_0045/stanza.py
+++ b/slixmpp/plugins/xep_0045/stanza.py
@@ -179,6 +179,21 @@ class MUCInvite(ElementBase):
interfaces = {'to', 'from', 'reason'}
sub_interfaces = {'reason'}
+ def get_to(self) -> JID:
+ return JID(self._get_attr('to'))
+
+ def set_to(self, value: Union[JID, str]):
+ if not isinstance(value, JID):
+ value = JID(value)
+ self._set_attr('to', value)
+
+ def get_from(self) -> JID:
+ return JID(self._get_attr('from'))
+
+ def set_from(self, value: Union[JID, str]):
+ if not isinstance(value, JID):
+ value = JID(value)
+ self._set_attr('from', value)
class MUCDecline(ElementBase):
name = 'decline'
@@ -187,6 +202,22 @@ class MUCDecline(ElementBase):
interfaces = {'to', 'from', 'reason'}
sub_interfaces = {'reason'}
+ def get_to(self) -> JID:
+ return JID(self._get_attr('to'))
+
+ def set_to(self, value: Union[JID, str]):
+ if not isinstance(value, JID):
+ value = JID(value)
+ self._set_attr('to', value)
+
+ def get_from(self) -> JID:
+ return JID(self._get_attr('from'))
+
+ def set_from(self, value: Union[JID, str]):
+ if not isinstance(value, JID):
+ value = JID(value)
+ self._set_attr('from', value)
+
class MUCHistory(ElementBase):
name = 'history'
@@ -204,6 +235,7 @@ class MUCOwnerQuery(ElementBase):
class MUCOwnerDestroy(ElementBase):
name = 'destroy'
plugin_attrib = 'destroy'
+ namespace = NS_OWNER
interfaces = {'reason', 'jid'}
sub_interfaces = {'reason'}
@@ -257,3 +289,11 @@ class MUCActor(ElementBase):
if jid:
return JID(jid)
return jid
+
+
+class MUCDestroy(ElementBase):
+ name = 'destroy'
+ plugin_attrib = 'destroy'
+ namespace = NS_USER
+ interfaces = {'reason', 'jid'}
+ sub_interfaces = {'reason'}