sms: transition from Unknown|Stored to Sent when the SMS is sent

This commit is contained in:
Aleksander Morgado
2012-09-06 18:25:38 +02:00
parent a5266406ba
commit c9a80609d4

View File

@@ -213,8 +213,14 @@ handle_send_ready (MMSms *self,
if (!MM_SMS_GET_CLASS (self)->send_finish (self, res, &error))
g_dbus_method_invocation_take_error (ctx->invocation, error);
else
else {
/* Transition from Unknown->Sent or Stored->Sent */
if (mm_gdbus_sms_get_state (MM_GDBUS_SMS (ctx->self)) == MM_SMS_STATE_UNKNOWN ||
mm_gdbus_sms_get_state (MM_GDBUS_SMS (ctx->self)) == MM_SMS_STATE_STORED)
mm_gdbus_sms_set_state (MM_GDBUS_SMS (ctx->self), MM_SMS_STATE_SENT);
mm_gdbus_sms_complete_send (MM_GDBUS_SMS (ctx->self), ctx->invocation);
}
handle_send_context_free (ctx);
}