Commit 8aeb5e80 authored by Mohammed Sadiq's avatar Mohammed Sadiq Committed by Sebastian Krzyszkowiak
Browse files

manager: Don't load second last message twice

When the conversation is created, the corresponding chat may
already have fetched the last message.  So load a message
only if no message is loaded.

Otherwise, if a user opens a chat, the second last message
is loaded when the conversation is created.  Also, when the
chat is loaded the recent history is loaded, and since both
these requests are done async, the second last message is
loaded twice.
parent 1ec2fb5d
......@@ -699,7 +699,14 @@ chatty_conv_new (PurpleConversation *conv)
purple_conversation_set_logging (conv, purple_value_get_boolean (value));
chatty_manager_load_more_chat (chatty_manager_get_default (), chat, 1);
GListModel *messages;
messages = chatty_chat_get_messages (chat);
if (g_list_model_get_n_items (messages) == 0)
chatty_manager_load_more_chat (chatty_manager_get_default (), chat, 1);
static void
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