summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-05-06 00:17:22 +0200
committermathieui <mathieui@mathieui.net>2014-05-06 00:17:22 +0200
commit16276cd163ae1761067ad5fef532fdf32da36bb5 (patch)
tree0c2e31f258d786b48f5c97c3a535ceed9f7bbc98 /src
parent467ae18290b080c07892d342b86728b4e7d3791e (diff)
downloadpoezio-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')
-rw-r--r--src/multiuserchat.py20
-rw-r--r--src/tabs/muctab.py4
2 files changed, 22 insertions, 2 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)
+
diff --git a/src/tabs/muctab.py b/src/tabs/muctab.py
index 201010f5..70f6fb70 100644
--- a/src/tabs/muctab.py
+++ b/src/tabs/muctab.py
@@ -372,14 +372,14 @@ class MucTab(ChatTab):
"""
The user do not want to send his/her config, send an iq cancel
"""
- self.core.xmpp.plugin['xep_0045'].cancelConfig(self.name)
+ muc.cancel_config(self.core.xmpp, self.name)
self.core.close_tab()
def send_config(self, form):
"""
The user sends his/her config to the server
"""
- self.core.xmpp.plugin['xep_0045'].configureRoom(self.name, form)
+ muc.configure_room(self.core.xmpp, self.name, form)
self.core.close_tab()
def command_cycle(self, arg):