diff options
author | fiaxh <git@lightrise.org> | 2019-04-12 17:43:47 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2019-04-14 09:46:54 +0200 |
commit | 6e1938b0893b47f0673bd773bdbfdbf6465ae018 (patch) | |
tree | 04ea42d63c7ef197923b49ebc5263371d4b81b9e /main/src/ui/unified_window_controller.vala | |
parent | d9e45071d0d3cd5a7a162908267c98c6366038bf (diff) | |
download | dino-6e1938b0893b47f0673bd773bdbfdbf6465ae018.tar.gz dino-6e1938b0893b47f0673bd773bdbfdbf6465ae018.zip |
Clean up ConversationTitlebar
Diffstat (limited to 'main/src/ui/unified_window_controller.vala')
-rw-r--r-- | main/src/ui/unified_window_controller.vala | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/main/src/ui/unified_window_controller.vala b/main/src/ui/unified_window_controller.vala index 912b235c..fa087dcc 100644 --- a/main/src/ui/unified_window_controller.vala +++ b/main/src/ui/unified_window_controller.vala @@ -79,7 +79,7 @@ public class UnifiedWindowController : Object { window.accounts_placeholder.primary_button.clicked.connect(() => { app.activate_action("accounts", null); }); window.conversations_placeholder.primary_button.clicked.connect(() => { app.activate_action("add_chat", null); }); window.conversations_placeholder.secondary_button.clicked.connect(() => { app.activate_action("add_conference", null); }); - window.filterable_conversation_list.conversation_selected.connect((conversation) => select_conversation(conversation)); + window.conversation_selector.conversation_selected.connect((conversation) => select_conversation(conversation)); var vadjustment = window.conversation_frame.scrolled.vadjustment; vadjustment.notify["value"].connect(() => { @@ -131,7 +131,7 @@ public class UnifiedWindowController : Object { stream_interactor.get_module(ChatInteraction.IDENTITY).on_conversation_selected(conversation); conversation.active = true; // only for conversation_selected - window.filterable_conversation_list.on_conversation_selected(conversation); // only for conversation_opened + window.conversation_selector.on_conversation_selected(conversation); // only for conversation_opened if (do_reset_search) { reset_search_entry(); @@ -148,10 +148,14 @@ public class UnifiedWindowController : Object { private void update_conversation_topic(string? subtitle = null) { if (subtitle != null) { - conversation_topic = subtitle; + conversation_topic = (/\s+/).replace_literal(subtitle, -1, 0, " "); } else if (conversation.type_ == Conversation.Type.GROUPCHAT) { - string subject = stream_interactor.get_module(MucManager.IDENTITY).get_groupchat_subject(conversation.counterpart, conversation.account); - conversation_topic = subject != "" ? subject : null; + string? subject = stream_interactor.get_module(MucManager.IDENTITY).get_groupchat_subject(conversation.counterpart, conversation.account); + if (subject != null) { + conversation_topic = (/\s+/).replace_literal(subject, -1, 0, " "); + } else { + conversation_topic = null; + } } else { conversation_topic = null; } |