summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0045.py
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@netflint.net>2010-01-25 10:40:50 -0800
committerNathan Fritz <fritzy@netflint.net>2010-01-25 10:40:50 -0800
commit65dd83d4e174fc5f88ea90b32dd9e3ebf1787294 (patch)
tree9710ceeebb74d49c6ae1926bae7be5188c4a9066 /sleekxmpp/plugins/xep_0045.py
parent6e4c1128ec8f01d31c7714c13db02ff20c7a0a40 (diff)
parent6b130eb94775da8675750a0a9aed75fa6f328137 (diff)
downloadslixmpp-65dd83d4e174fc5f88ea90b32dd9e3ebf1787294.tar.gz
slixmpp-65dd83d4e174fc5f88ea90b32dd9e3ebf1787294.tar.bz2
slixmpp-65dd83d4e174fc5f88ea90b32dd9e3ebf1787294.tar.xz
slixmpp-65dd83d4e174fc5f88ea90b32dd9e3ebf1787294.zip
Merge branch 'master' of github.com:fritzy/SleekXMPP
Diffstat (limited to 'sleekxmpp/plugins/xep_0045.py')
-rw-r--r--sleekxmpp/plugins/xep_0045.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sleekxmpp/plugins/xep_0045.py b/sleekxmpp/plugins/xep_0045.py
index 4b181f99..82737421 100644
--- a/sleekxmpp/plugins/xep_0045.py
+++ b/sleekxmpp/plugins/xep_0045.py
@@ -223,12 +223,15 @@ class xep_0045(base.base_plugin):
return False
return True
- def setAffiliation(self, room, jid, affiliation='member'):
+ def setAffiliation(self, room, jid=None, nick=None, affiliation='member'):
""" Change room affiliation."""
if affiliation not in ('outcast', 'member', 'admin', 'owner', 'none'):
raise TypeError
query = ET.Element('{http://jabber.org/protocol/muc#admin}query')
- item = ET.Element('item', {'affiliation':affiliation, 'jid':jid})
+ if nick is not None:
+ item = ET.Element('item', {'affiliation':affiliation, 'nick':nick})
+ else:
+ item = ET.Element('item', {'affiliation':affiliation, 'jid':jid})
query.append(item)
iq = self.xmpp.makeIqSet(query)
iq['to'] = room