aboutsummaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
Diffstat (limited to 'main/src')
-rw-r--r--main/src/ui/add_conversation/chat/dialog.vala5
-rw-r--r--main/src/ui/add_conversation/conference/conference_list.vala12
-rw-r--r--main/src/ui/unified_window.vala18
3 files changed, 19 insertions, 16 deletions
diff --git a/main/src/ui/add_conversation/chat/dialog.vala b/main/src/ui/add_conversation/chat/dialog.vala
index 15624731..910e7264 100644
--- a/main/src/ui/add_conversation/chat/dialog.vala
+++ b/main/src/ui/add_conversation/chat/dialog.vala
@@ -71,9 +71,8 @@ public class Dialog : Gtk.Dialog {
protected void on_ok_button_clicked() {
ListRow? selected_row = roster_list.get_selected_row() as ListRow;
if (selected_row != null) {
- // TODO move in list to front immediately
- stream_interactor.get_module(ConversationManager.IDENTITY).ensure_start_conversation(selected_row.jid, selected_row.account);
- Conversation conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation(selected_row.jid, selected_row.account);
+ Conversation conversation = stream_interactor.get_module(ConversationManager.IDENTITY).create_conversation(selected_row.jid, selected_row.account, Conversation.Type.CHAT);
+ stream_interactor.get_module(ConversationManager.IDENTITY).start_conversation(conversation, true);
conversation_opened(conversation);
}
close();
diff --git a/main/src/ui/add_conversation/conference/conference_list.vala b/main/src/ui/add_conversation/conference/conference_list.vala
index c44f989a..d11271d8 100644
--- a/main/src/ui/add_conversation/conference/conference_list.vala
+++ b/main/src/ui/add_conversation/conference/conference_list.vala
@@ -43,11 +43,13 @@ protected class ConferenceList : FilterableList {
}
private static void on_conference_bookmarks_received(Core.XmppStream stream, ArrayList<Xep.Bookmarks.Conference> conferences, Object? o) {
- Tuple<ConferenceList, Account> tuple = o as Tuple<ConferenceList, Account>;
- ConferenceList list = tuple.a;
- Account account = tuple.b;
- list.lists[account] = conferences;
- Idle.add(() => { list.refresh_conferences(); return false; });
+ Idle.add(() => {
+ Tuple<ConferenceList, Account> tuple = o as Tuple<ConferenceList, Account>;
+ ConferenceList list = tuple.a;
+ Account account = tuple.b;
+ list.lists[account] = conferences;
+ list.refresh_conferences(); return false;
+ });
}
private void header(ListBoxRow row, ListBoxRow? before_row) {
diff --git a/main/src/ui/unified_window.vala b/main/src/ui/unified_window.vala
index 66a4a087..35f97d6e 100644
--- a/main/src/ui/unified_window.vala
+++ b/main/src/ui/unified_window.vala
@@ -51,14 +51,16 @@ public class UnifiedWindow : Window {
}
public void on_conversation_selected(Conversation conversation) {
- this.conversation = conversation;
- stream_interactor.get_module(ChatInteraction.IDENTITY).on_conversation_selected(conversation);
- conversation.active = true; // only for conversation_selected
- filterable_conversation_list.conversation_list.on_conversation_selected(conversation); // only for conversation_opened
-
- chat_input.initialize_for_conversation(conversation);
- conversation_frame.initialize_for_conversation(conversation);
- conversation_titlebar.initialize_for_conversation(conversation);
+ if (this.conversation == null || !this.conversation.equals(conversation)) {
+ this.conversation = conversation;
+ stream_interactor.get_module(ChatInteraction.IDENTITY).on_conversation_selected(conversation);
+ conversation.active = true; // only for conversation_selected
+ filterable_conversation_list.conversation_list.on_conversation_selected(conversation); // only for conversation_opened
+
+ chat_input.initialize_for_conversation(conversation);
+ conversation_frame.initialize_for_conversation(conversation);
+ conversation_titlebar.initialize_for_conversation(conversation);
+ }
}
private void setup_unified() {