Mercurial > libervia-backend
diff sat_frontends/quick_frontend/quick_app.py @ 4041:2594e1951cf7
core (bridge): `action_new` now use serialised dict for extra data.
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 15 May 2023 16:20:45 +0200 |
parents | 524856bd7b19 |
children | 4b842c1fb686 |
line wrap: on
line diff
--- a/sat_frontends/quick_frontend/quick_app.py Mon May 15 16:20:38 2023 +0200 +++ b/sat_frontends/quick_frontend/quick_app.py Mon May 15 16:20:45 2023 +0200 @@ -742,8 +742,10 @@ self.sync = False self.set_presence_status(C.PRESENCE_UNAVAILABLE, "", profile=profile) - def action_new_handler(self, action_data, id_, security_limit, profile): - self.action_manager(action_data, user_action=False, profile=profile) + def action_new_handler(self, action_data_s, id_, security_limit, profile): + self.action_manager( + data_format.deserialise(action_data_s), user_action=False, profile=profile + ) def contact_new_handler(self, jid_s, attributes, groups, profile): entity = jid.JID(jid_s) @@ -1298,18 +1300,6 @@ self.register_progress_cbs(progress_id, progress_cb, progress_eb) self.progress_id_handler(progress_id, profile) - # we ignore metadata - action_data = { - k: v for k, v in action_data.items() if not k.startswith("meta_") - } - - if action_data: - raise exceptions.DataError( - "Not all keys in action_data are managed ({keys})".format( - keys=", ".join(list(action_data.keys())) - ) - ) - def _action_cb(self, data, callback, callback_id, profile): if callback is None: self.action_manager(data, profile=profile) @@ -1334,9 +1324,12 @@ """ if data is None: data = dict() - action_cb = lambda data: self._action_cb(data, callback, callback_id, profile) + action_cb = lambda data: self._action_cb( + data_format.deserialise(data), callback, callback_id, profile + ) self.bridge.action_launch( - callback_id, data, profile, callback=action_cb, errback=self.dialog_failure + callback_id, data_format.serialise(data), profile, callback=action_cb, + errback=self.dialog_failure ) def launch_menu(