Commit b3ed6cf4 authored by Link Mauve's avatar Link Mauve

Use some of the new xep_0045 methods from slixmpp 1.6.0

parent c14a08d7
Pipeline #3494 passed with stages
in 5 minutes and 44 seconds
......@@ -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()
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment