Commit 184f354e authored by mathieui's avatar mathieui Committed by Link Mauve

muc: remove get_room_form hack and callbacks

parent 341c770b
......@@ -26,23 +26,6 @@ def has_identity(xmpp, jid, identity, on_true=None, on_false=None):
xmpp.plugin['xep_0030'].get_info(jid=jid, callback=_cb)
def get_room_form(xmpp: ClientXMPP, room: str, callback: Callable[[Iq], Any]):
def _cb(result):
if result["type"] == "error":
return callback(None)
xform = result.xml.find(
if xform is None:
return callback(None)
form = xmpp.plugin['xep_0004'].build_form(xform)
return callback(form)
iq = xmpp.make_iq_get(ito=room)
query = ET.Element('{}query')
def _filter_add_receipt_request(self, stanza):
Auto add receipt requests to outgoing messages, if:
......@@ -1404,19 +1404,19 @@ class MucTab(ChatTab):
self.core.information("Unknown user: %s" % nick, "Error")
def command_configure(self, ignored: Any) -> None:
async def command_configure(self, ignored: Any) -> None:
def on_form_received(form: Form) -> None:
if not form:
'Could not retrieve the configuration form', 'Error')
form = await self.core.xmpp.plugin['xep_0045'].get_room_config(
self.core.open_new_form(form, self.cancel_config, self.send_config)
fixes.get_room_form(self.core.xmpp, self.jid.bare, on_form_received)
except (IqError, IqTimeout, ValueError):
'Could not retrieve the configuration form', 'Error')
def command_cycle(self, msg: str) -> 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