diff --git a/poezio/multiuserchat.py b/poezio/multiuserchat.py index 12f97661..e6460030 100644 --- a/poezio/multiuserchat.py +++ b/poezio/multiuserchat.py @@ -240,24 +240,3 @@ def set_user_affiliation( iq = xmpp.make_iq_set(query) iq['to'] = muc_jid iq.send(callback=callback) - - -def cancel_config(xmpp: ClientXMPP, room: str) -> None: - query = ET.Element('{http://jabber.org/protocol/muc#owner}query') - x = ET.Element('{jabber:x:data}x', type='cancel') - query.append(x) - iq = xmpp.make_iq_set(query) - iq['to'] = room - iq.send() - - -def configure_room(xmpp: ClientXMPP, room: str, form: 'Form') -> None: - if form is None: - return - iq = xmpp.make_iq_set() - iq['to'] = room - query = ET.Element('{http://jabber.org/protocol/muc#owner}query') - form['type'] = 'submit' - query.append(form.xml) - iq.append(query) - iq.send() diff --git a/poezio/tabs/muctab.py b/poezio/tabs/muctab.py index e1366bcd..182e7145 100644 --- a/poezio/tabs/muctab.py +++ b/poezio/tabs/muctab.py @@ -153,14 +153,14 @@ class MucTab(ChatTab): """ The user do not want to send their config, send an iq cancel """ - muc.cancel_config(self.core.xmpp, self.jid.bare) + asyncio.ensure_future(self.core.xmpp['xep_0045'].cancel_config(self.jid.bare)) self.core.close_tab() def send_config(self, form: 'Form') -> None: """ The user sends their config to the server """ - muc.configure_room(self.core.xmpp, self.jid.bare, form) + asyncio.ensure_future(self.core.xmpp['xep_0045'].set_room_config(self.jid.bare, form)) self.core.close_tab() def join(self) -> None: