diff options
Diffstat (limited to 'main/src/ui/conversation_titlebar')
-rw-r--r-- | main/src/ui/conversation_titlebar/view.vala | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/main/src/ui/conversation_titlebar/view.vala b/main/src/ui/conversation_titlebar/view.vala index 4ca57e1c..924ca15e 100644 --- a/main/src/ui/conversation_titlebar/view.vala +++ b/main/src/ui/conversation_titlebar/view.vala @@ -36,9 +36,15 @@ public class ConversationTitlebar : Gtk.HeaderBar { } + stream_interactor.get_module(MucManager.IDENTITY).room_name_set.connect((account, jid, room_name) => { + if (conversation != null && conversation.counterpart.equals_bare(jid) && conversation.account.equals(account)) { + update_title(); + } + }); + stream_interactor.get_module(MucManager.IDENTITY).subject_set.connect((account, jid, subject) => { if (conversation != null && conversation.counterpart.equals_bare(jid) && conversation.account.equals(account)) { - update_subtitle(subject); + update_subtitle(); } }); } @@ -57,17 +63,10 @@ public class ConversationTitlebar : Gtk.HeaderBar { set_title(Util.get_conversation_display_name(stream_interactor, conversation)); } - private void update_subtitle(string? subtitle = null) { - if (subtitle != null) { - set_subtitle(subtitle); - } else if (conversation.type_ == Conversation.Type.GROUPCHAT) { - string? subject = stream_interactor.get_module(MucManager.IDENTITY).get_groupchat_subject(conversation.counterpart, conversation.account); - if (subject != null) { - subject = (new Regex("\\s+")).replace_literal(subject, -1, 0, " "); - } - set_subtitle(subject != "" ? subject : null); - } else { - set_subtitle(null); + private void update_subtitle() { + if (conversation.type_ == Conversation.Type.GROUPCHAT) { + string groupchat_subject = stream_interactor.get_module(MucManager.IDENTITY).get_groupchat_subject(conversation.counterpart, conversation.account); + set_subtitle(groupchat_subject); } } } |