diff options
author | Aleksander Morgado <aleksandermj@chromium.org> | 2022-11-30 12:45:52 +0000 |
---|---|---|
committer | Aleksander Morgado <aleksandermj@chromium.org> | 2022-11-30 13:02:07 +0000 |
commit | ef6cf656f7d5cf497b416c7da1273d2b9aa749ec (patch) | |
tree | b5fb6fb2b0b71e78f0674b90ae19f35f783d488c /src/mm-iface-modem-messaging.c | |
parent | f4d867cd5977380b7a07da066ad08cd7079942da (diff) |
iface-modem-messaging: allow Delete operation during enabling/disabling
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/671
Diffstat (limited to 'src/mm-iface-modem-messaging.c')
-rw-r--r-- | src/mm-iface-modem-messaging.c | 7 |
1 files changed, 6 insertions, 1 deletions
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, |