summaryrefslogtreecommitdiff
path: root/src/multiuserchat.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/multiuserchat.py')
-rw-r--r--src/multiuserchat.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/multiuserchat.py b/src/multiuserchat.py
index 386da341..013fd2cb 100644
--- a/src/multiuserchat.py
+++ b/src/multiuserchat.py
@@ -127,6 +127,12 @@ def set_user_affiliation(xmpp, muc_jid, affiliation, nick=None, jid=None, reason
item = ET.Element('{http://jabber.org/protocol/muc#admin}item', {'affiliation':affiliation, 'nick':nick})
else:
item = ET.Element('{http://jabber.org/protocol/muc#admin}item', {'affiliation':affiliation, 'jid':str(jid)})
+
+ if reason:
+ reason_item = ET.Element('{http://jabber.org/protocol/muc#admin}reason')
+ reason_item.text = reason
+ item.append(reason_item)
+
query.append(item)
iq = xmpp.makeIqSet(query)
iq['to'] = muc_jid