Commit 3d6616e0 authored by Mohammed Sadiq's avatar Mohammed Sadiq
Browse files

mm: Add message to chat early

Don't wait until the SMS is actually sent to let the message
added to the chat list, which can result in the message being
shown very late as SMS messages are sent serially.
parent 3ecee854
Pipeline #70735 passed with stages
in 8 minutes and 6 seconds
......@@ -373,6 +373,7 @@ chatty_mm_chat_send_message_async (ChattyChat *chat,
task = g_task_new (self, NULL, callback, user_data);
g_task_set_task_data (task, g_object_ref (message), g_object_unref);
chatty_mm_chat_append_message (CHATTY_MM_CHAT (chat), message);
g_queue_push_head (self->message_queue, task);
mm_chat_send_message_from_queue (self);
......@@ -1075,8 +1075,6 @@ chatty_mm_account_send_message_async (ChattyMmAccount *self,
mm_sms_properties_set_delivery_report_request (sms_properties, request_report);
mm_sms_properties_set_validity_relative (sms_properties, 168);
chatty_mm_chat_append_message (CHATTY_MM_CHAT (chat), message);
if (chatty_utils_get_item_position (G_LIST_MODEL (self->chat_list), chat, &position))
g_list_model_items_changed (G_LIST_MODEL (self->chat_list), position, 1, 1);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment