diff options
author | mathieui <mathieui@mathieui.net> | 2014-05-06 00:17:22 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2014-05-06 00:17:22 +0200 |
commit | 16276cd163ae1761067ad5fef532fdf32da36bb5 (patch) | |
tree | 0c2e31f258d786b48f5c97c3a535ceed9f7bbc98 /src/multiuserchat.py | |
parent | 467ae18290b080c07892d342b86728b4e7d3791e (diff) | |
download | poezio-16276cd163ae1761067ad5fef532fdf32da36bb5.tar.gz poezio-16276cd163ae1761067ad5fef532fdf32da36bb5.tar.bz2 poezio-16276cd163ae1761067ad5fef532fdf32da36bb5.tar.xz poezio-16276cd163ae1761067ad5fef532fdf32da36bb5.zip |
Provide our own (non-blocking) wrappers for room configuration functions
Diffstat (limited to 'src/multiuserchat.py')
-rw-r--r-- | src/multiuserchat.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/multiuserchat.py b/src/multiuserchat.py index ccf33ed1..ae8acb77 100644 --- a/src/multiuserchat.py +++ b/src/multiuserchat.py @@ -175,3 +175,23 @@ def set_user_affiliation(xmpp, muc_jid, affiliation, nick=None, jid=None, reason import traceback log.debug('Error setting the affiliation: %s', traceback.format_exc()) return False + +def cancel_config(xmpp, room): + query = ET.Element('{http://jabber.org/protocol/muc#owner}query') + x = ET.Element('{jabber:x:data}x', type='cancel') + query.append(x) + iq = xmpp.makeIqSet(query) + iq['to'] = room + iq.send(block=False) + +def configure_room(xmpp, room, form): + if form is None: + return + iq = xmpp.makeIqSet() + iq['to'] = room + query = ET.Element('{http://jabber.org/protocol/muc#owner}query') + form = form.getXML('submit') + query.append(form) + iq.append(query) + iq.send(block=False) + |