sms: set state back to UNKNOWN when all SMS parts were deleted
This commit is contained in:
20
src/mm-sms.c
20
src/mm-sms.c
@@ -863,12 +863,9 @@ delete_next_part (SmsDeletePartsContext *ctx)
|
|||||||
MM_CORE_ERROR_FAILED,
|
MM_CORE_ERROR_FAILED,
|
||||||
"Couldn't delete %u parts from this SMS",
|
"Couldn't delete %u parts from this SMS",
|
||||||
ctx->n_failed);
|
ctx->n_failed);
|
||||||
else {
|
else
|
||||||
/* We do change the state of this SMS back to UNKNOWN, as it is no
|
|
||||||
* longer stored in the device */
|
|
||||||
mm_gdbus_sms_set_state (MM_GDBUS_SMS (ctx->self), MM_SMS_STATE_UNKNOWN);
|
|
||||||
g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);
|
g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);
|
||||||
}
|
|
||||||
sms_delete_parts_context_complete_and_free (ctx);
|
sms_delete_parts_context_complete_and_free (ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -911,8 +908,17 @@ mm_sms_delete_finish (MMSms *self,
|
|||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
if (MM_SMS_GET_CLASS (self)->delete_finish)
|
if (MM_SMS_GET_CLASS (self)->delete_finish) {
|
||||||
return MM_SMS_GET_CLASS (self)->delete_finish (self, res, error);
|
gboolean deleted;
|
||||||
|
|
||||||
|
deleted = MM_SMS_GET_CLASS (self)->delete_finish (self, res, error);
|
||||||
|
if (deleted)
|
||||||
|
/* We do change the state of this SMS back to UNKNOWN, as it is no
|
||||||
|
* longer stored in the device */
|
||||||
|
mm_gdbus_sms_set_state (MM_GDBUS_SMS (self), MM_SMS_STATE_UNKNOWN);
|
||||||
|
|
||||||
|
return deleted;
|
||||||
|
}
|
||||||
|
|
||||||
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user