From ef6cf656f7d5cf497b416c7da1273d2b9aa749ec Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 30 Nov 2022 12:45:52 +0000 Subject: iface-modem-messaging: allow Delete operation during enabling/disabling Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/671 --- src/mm-iface-modem-messaging.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mm-iface-modem-messaging.c b/src/mm-iface-modem-messaging.c index f9c2c98b..bd9efcea 100644 --- a/src/mm-iface-modem-messaging.c +++ b/src/mm-iface-modem-messaging.c @@ -193,7 +193,12 @@ handle_delete_auth_ready (MMBaseModem *self, MM_IFACE_MODEM_STATE, &modem_state, NULL); - if (modem_state < MM_MODEM_STATE_ENABLED) { + /* We do allow deleting SMS messages while enabling or disabling, it doesn't + * interfere with the state transition logic to do so. The main reason to allow + * this is that during modem enabling we're emitting "Added" signals before we + * reach the enabled state, and so users listening to the signal may want to + * delete the SMS message as soon as it's read. */ + if (modem_state <= MM_MODEM_STATE_DISABLED) { g_dbus_method_invocation_return_error (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_WRONG_STATE, -- cgit v1.2.3-70-g09d2