From 184f354e8dac7b49243a1069b9f43c54f4bbe26c Mon Sep 17 00:00:00 2001 From: mathieui Date: Sat, 30 Jan 2021 12:26:20 +0100 Subject: muc: remove get_room_form hack and callbacks --- poezio/tabs/muctab.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'poezio/tabs/muctab.py') diff --git a/poezio/tabs/muctab.py b/poezio/tabs/muctab.py index 69256cfe..008a72c0 100644 --- a/poezio/tabs/muctab.py +++ b/poezio/tabs/muctab.py @@ -1404,19 +1404,19 @@ class MucTab(ChatTab): self.core.information("Unknown user: %s" % nick, "Error") @command_args_parser.quoted(0) - def command_configure(self, ignored: Any) -> None: + async def command_configure(self, ignored: Any) -> None: """ /configure """ - def on_form_received(form: Form) -> None: - if not form: - self.core.information( - 'Could not retrieve the configuration form', 'Error') - return + try: + form = await self.core.xmpp.plugin['xep_0045'].get_room_config( + self.jid.bare + ) 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): + self.core.information( + 'Could not retrieve the configuration form', 'Error') @command_args_parser.raw def command_cycle(self, msg: str) -> None: -- cgit v1.2.3