From df6328dfcb9031092ae2f1ba1ef18da600605338 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Fri, 1 Mar 2019 18:20:08 +0100 Subject: [PATCH] Fix topic displaying issues fixes #393 --- main/src/ui/unified_window.vala | 5 +++-- main/src/ui/unified_window_controller.vala | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/main/src/ui/unified_window.vala b/main/src/ui/unified_window.vala index 8338573e..44107fb3 100644 --- a/main/src/ui/unified_window.vala +++ b/main/src/ui/unified_window.vala @@ -28,10 +28,11 @@ public class UnifiedWindow : Gtk.Window { return Util.use_csd() ? conversation_titlebar_csd.subtitle : conversation_titlebar.subtitle; } set { + string? new_subtitle = value == null ? null : (new Regex("\\s+")).replace_literal(value, -1, 0, " "); if (Util.use_csd()) { - conversation_titlebar_csd.subtitle = value; + conversation_titlebar_csd.subtitle = new_subtitle; } else { - conversation_titlebar.subtitle = value; + conversation_titlebar.subtitle = new_subtitle; } } } diff --git a/main/src/ui/unified_window_controller.vala b/main/src/ui/unified_window_controller.vala index dce5b39f..bef6b7dc 100644 --- a/main/src/ui/unified_window_controller.vala +++ b/main/src/ui/unified_window_controller.vala @@ -147,7 +147,7 @@ public class UnifiedWindowController : Object { } private void update_conversation_topic(string? subtitle = null) { - if (conversation_topic != null) { + if (subtitle != null) { conversation_topic = subtitle; } else if (conversation.type_ == Conversation.Type.GROUPCHAT) { string subject = stream_interactor.get_module(MucManager.IDENTITY).get_groupchat_subject(conversation.counterpart, conversation.account);