iface-modem-messaging: allow Delete operation during enabling/disabling
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/671
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user