From cbe0ff2c1d6eb86520fdba05183f33cd4f262bcd Mon Sep 17 00:00:00 2001
From: fiaxh <git@lightrise.org>
Date: Thu, 18 Apr 2019 22:38:16 +0200
Subject: Don't move opened conversation to the top of the list, scroll along
 with selected conversation

fixes #544
---
 main/src/ui/add_conversation/add_conference_dialog.vala         | 2 +-
 main/src/ui/add_conversation/select_contact_dialog.vala         | 2 +-
 main/src/ui/application.vala                                    | 2 +-
 main/src/ui/conversation_selector/conversation_selector.vala    | 1 +
 main/src/ui/conversation_summary/subscription_notification.vala | 2 +-
 main/src/ui/occupant_menu/view.vala                             | 2 +-
 6 files changed, 6 insertions(+), 5 deletions(-)

(limited to 'main/src/ui')

diff --git a/main/src/ui/add_conversation/add_conference_dialog.vala b/main/src/ui/add_conversation/add_conference_dialog.vala
index c9bc42ad..fb1a2aca 100644
--- a/main/src/ui/add_conversation/add_conference_dialog.vala
+++ b/main/src/ui/add_conversation/add_conference_dialog.vala
@@ -141,7 +141,7 @@ public class AddConferenceDialog : Gtk.Dialog {
     private void on_joined(Account account, Jid jid, string nick) {
         if (account.equals(details_fragment.account) && jid.equals_bare(new Jid(details_fragment.jid))) {
             Conversation conversation = stream_interactor.get_module(ConversationManager.IDENTITY).create_conversation(jid, account, Conversation.Type.GROUPCHAT);
-            stream_interactor.get_module(ConversationManager.IDENTITY).start_conversation(conversation, true);
+            stream_interactor.get_module(ConversationManager.IDENTITY).start_conversation(conversation);
             conversation_opened(conversation);
             close();
         }
diff --git a/main/src/ui/add_conversation/select_contact_dialog.vala b/main/src/ui/add_conversation/select_contact_dialog.vala
index 6b9d4947..b387787a 100644
--- a/main/src/ui/add_conversation/select_contact_dialog.vala
+++ b/main/src/ui/add_conversation/select_contact_dialog.vala
@@ -86,7 +86,7 @@ public class AddChatDialog : SelectContactDialog {
         ok_button.label = _("Start");
         selected.connect((account, jid) => {
             Conversation conversation = stream_interactor.get_module(ConversationManager.IDENTITY).create_conversation(jid, account, Conversation.Type.CHAT);
-            stream_interactor.get_module(ConversationManager.IDENTITY).start_conversation(conversation, true);
+            stream_interactor.get_module(ConversationManager.IDENTITY).start_conversation(conversation);
             added(conversation);
         });
     }
diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala
index 29dec20c..6ea8eb01 100644
--- a/main/src/ui/application.vala
+++ b/main/src/ui/application.vala
@@ -66,7 +66,7 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application {
                 Gee.List<Account> accounts = stream_interactor.get_accounts();
                 if (accounts.size == 1) {
                     Conversation conversation = stream_interactor.get_module(ConversationManager.IDENTITY).create_conversation(new Jid(jid), accounts[0], Conversation.Type.CHAT);
-                    stream_interactor.get_module(ConversationManager.IDENTITY).start_conversation(conversation, true);
+                    stream_interactor.get_module(ConversationManager.IDENTITY).start_conversation(conversation);
                     window.on_conversation_selected(conversation);
                 } else {
                     AddChatDialog dialog = new AddChatDialog(stream_interactor, stream_interactor.get_accounts());
diff --git a/main/src/ui/conversation_selector/conversation_selector.vala b/main/src/ui/conversation_selector/conversation_selector.vala
index d795120b..dd264206 100644
--- a/main/src/ui/conversation_selector/conversation_selector.vala
+++ b/main/src/ui/conversation_selector/conversation_selector.vala
@@ -68,6 +68,7 @@ public class ConversationSelector : ListBox {
         if (!rows.has_key(conversation)) {
             add_conversation(conversation);
         }
+        rows[conversation].grab_focus();
         this.select_row(rows[conversation]);
     }
 
diff --git a/main/src/ui/conversation_summary/subscription_notification.vala b/main/src/ui/conversation_summary/subscription_notification.vala
index 225e4b00..d493ff78 100644
--- a/main/src/ui/conversation_summary/subscription_notification.vala
+++ b/main/src/ui/conversation_summary/subscription_notification.vala
@@ -16,7 +16,7 @@ public class SubscriptionNotitication : Object {
 
         stream_interactor.get_module(PresenceManager.IDENTITY).received_subscription_request.connect((jid, account) => {
             Conversation relevant_conversation = stream_interactor.get_module(ConversationManager.IDENTITY).create_conversation(jid, account, Conversation.Type.CHAT);
-            stream_interactor.get_module(ConversationManager.IDENTITY).start_conversation(relevant_conversation, true);
+            stream_interactor.get_module(ConversationManager.IDENTITY).start_conversation(relevant_conversation);
             if (conversation != null && account.equals(conversation.account) && jid.equals(conversation.counterpart)) {
                 show_notification();
             }
diff --git a/main/src/ui/occupant_menu/view.vala b/main/src/ui/occupant_menu/view.vala
index 0d11a310..119d7cfe 100644
--- a/main/src/ui/occupant_menu/view.vala
+++ b/main/src/ui/occupant_menu/view.vala
@@ -106,7 +106,7 @@ public class View : Popover {
         if (list_row == null) return;
 
         Conversation conversation = stream_interactor.get_module(ConversationManager.IDENTITY).create_conversation(list_row.jid, list_row.account, Conversation.Type.GROUPCHAT_PM);
-        stream_interactor.get_module(ConversationManager.IDENTITY).start_conversation(conversation, true);
+        stream_interactor.get_module(ConversationManager.IDENTITY).start_conversation(conversation);
     }
 
     private void kick_button_clicked() {
-- 
cgit v1.2.3-70-g09d2