aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2018-09-12 00:29:03 +0200
committerfiaxh <git@mx.ax.lt>2018-09-12 00:29:03 +0200
commit83bf0631a5e3d1a17dde01a868edda487a46e68d (patch)
treed7ceebbe2f6f10560981df60fd26dfde6ec2075a
parentf87611412660b89ee9451820fc9c58162a11e243 (diff)
downloaddino-83bf0631a5e3d1a17dde01a868edda487a46e68d.tar.gz
dino-83bf0631a5e3d1a17dde01a868edda487a46e68d.zip
Remove newlines from displayed MUC topics
fixes #393
-rw-r--r--main/src/ui/conversation_titlebar/view.vala5
1 files changed, 4 insertions, 1 deletions
diff --git a/main/src/ui/conversation_titlebar/view.vala b/main/src/ui/conversation_titlebar/view.vala
index 13a9bf80..4ca57e1c 100644
--- a/main/src/ui/conversation_titlebar/view.vala
+++ b/main/src/ui/conversation_titlebar/view.vala
@@ -61,7 +61,10 @@ public class ConversationTitlebar : Gtk.HeaderBar {
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);
+ 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);