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

window: Hide rows with empty chat when folded

When a new chat is created, it is added to the chat list.  If
the user goes back to chat list without adding any chat message,
hide the newly created chat as the user likely cancelled the chat.
parent 23aa35a4
......@@ -308,6 +308,18 @@ window_chat_name_matches (ChattyItem *item,
return FALSE;
}
if (hdy_leaflet_get_fold (HDY_LEAFLET (self->header_box)) == HDY_FOLD_FOLDED) {
GListModel *message_list;
guint n_items;
message_list = chatty_chat_get_messages (CHATTY_CHAT (item));
n_items = g_list_model_get_n_items (message_list);
if (n_items == 0)
return FALSE;
}
if (!self->chat_needle || !*self->chat_needle)
return TRUE;
......@@ -441,6 +453,7 @@ notify_fold_cb (GObject *sender,
chatty_window_chat_list_select_first (self);
}
gtk_filter_changed (self->chat_filter, GTK_FILTER_CHANGE_DIFFERENT);
chatty_update_header (self);
}
......
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