ringmainwindow: do not open first conversation when not necessary
Actually when we select the second conversation and click enter when
the focus is on the search_entry or click on the add button, it opens
the first conversation. With this patch, this behavior is removed.
Change-Id: If3c4bb1e302da1ecdf1df0ef3fe0c86cedc024a3
diff --git a/src/ringmainwindow.cpp b/src/ringmainwindow.cpp
index 5d3ecc6..9577dad 100644
--- a/src/ringmainwindow.cpp
+++ b/src/ringmainwindow.cpp
@@ -384,7 +384,10 @@
// Select the first conversation of the list
auto& conversationModel = priv->cpp->accountContainer_->info.conversationModel;
auto conversations = conversationModel->allFilteredConversations();
- if (!conversations.empty())
+
+ const gchar *text = gtk_entry_get_text(GTK_ENTRY(priv->search_entry));
+
+ if (!conversations.empty() && text && !std::string(text).empty())
conversationModel->selectConversation(conversations[0].uid);
}