summaryrefslogtreecommitdiff
path: root/slixmpp/plugins/xep_0045/muc.py
diff options
context:
space:
mode:
Diffstat (limited to 'slixmpp/plugins/xep_0045/muc.py')
-rw-r--r--slixmpp/plugins/xep_0045/muc.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/slixmpp/plugins/xep_0045/muc.py b/slixmpp/plugins/xep_0045/muc.py
index 1ff7632b..aa1ed9e9 100644
--- a/slixmpp/plugins/xep_0045/muc.py
+++ b/slixmpp/plugins/xep_0045/muc.py
@@ -242,7 +242,7 @@ class XEP_0045(BasePlugin):
await iq.send(**iqkwargs)
async def set_affiliation(self, room: JID, jid: Optional[JID] = None, nick: Optional[str] = None, *, affiliation: str,
- ifrom: Optional[JID] = None, **iqkwargs):
+ reason: str = '', ifrom: Optional[JID] = None, **iqkwargs):
""" Change room affiliation."""
if affiliation not in AFFILIATIONS:
raise ValueError('%s is not a valid affiliation' % affiliation)
@@ -256,11 +256,13 @@ class XEP_0045(BasePlugin):
item['nick'] = nick
if jid:
item['jid'] = jid
+ if reason:
+ item['reason'] = reason
iq['mucadmin_query'].append(item)
await iq.send(**iqkwargs)
async def set_role(self, room: JID, nick: str, role: str, *,
- ifrom: Optional[JID] = None, **iqkwargs):
+ reason: str = '', ifrom: Optional[JID] = None, **iqkwargs):
""" Change role property of a nick in a room.
Typically, roles are temporary (they last only as long as you are in the
room), whereas affiliations are permanent (they last across groupchat
@@ -273,6 +275,8 @@ class XEP_0045(BasePlugin):
item = MUCAdminItem()
item['role'] = role
item['nick'] = nick
+ if reason:
+ item['reason'] = reason
iq['mucadmin_query'].append(item)
await iq.send(**iqkwargs)