diff options
author | Nathan Fritz <fritzy@netflint.net> | 2010-01-20 01:42:53 -0800 |
---|---|---|
committer | Nathan Fritz <fritzy@netflint.net> | 2010-01-20 01:42:53 -0800 |
commit | 6b130eb94775da8675750a0a9aed75fa6f328137 (patch) | |
tree | de4a1f3149d4f4f45ebd93ecc7597895b29e8e00 /sleekxmpp/plugins | |
parent | 986255eefc890263f7a326c53d3094fd5858272a (diff) | |
download | slixmpp-6b130eb94775da8675750a0a9aed75fa6f328137.tar.gz slixmpp-6b130eb94775da8675750a0a9aed75fa6f328137.tar.bz2 slixmpp-6b130eb94775da8675750a0a9aed75fa6f328137.tar.xz slixmpp-6b130eb94775da8675750a0a9aed75fa6f328137.zip |
unhandled iq's should only respond to errors when type=get/set
Diffstat (limited to 'sleekxmpp/plugins')
-rw-r--r-- | sleekxmpp/plugins/xep_0045.py | 7 |
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 |