aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2018-11-02 15:23:58 +0100
committerfiaxh <git@mx.ax.lt>2018-11-02 15:23:58 +0100
commitddd17e720e9170ea7016e2fdf80f91808666ec36 (patch)
tree06d832bb0310c4886b8651a197193fd54b2085fc
parent1e54a442ba78cd117c0262b9b5e83ef4438e5858 (diff)
downloaddino-ddd17e720e9170ea7016e2fdf80f91808666ec36.tar.gz
dino-ddd17e720e9170ea7016e2fdf80f91808666ec36.zip
fixup 1e54a44
-rw-r--r--main/src/ui/conversation_titlebar/view.vala14
-rw-r--r--main/src/ui/util/helper.vala2
2 files changed, 10 insertions, 6 deletions
diff --git a/main/src/ui/conversation_titlebar/view.vala b/main/src/ui/conversation_titlebar/view.vala
index 924ca15e..7ee47311 100644
--- a/main/src/ui/conversation_titlebar/view.vala
+++ b/main/src/ui/conversation_titlebar/view.vala
@@ -44,7 +44,7 @@ public class ConversationTitlebar : Gtk.HeaderBar {
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();
+ update_subtitle(subject);
}
});
}
@@ -63,10 +63,14 @@ public class ConversationTitlebar : Gtk.HeaderBar {
set_title(Util.get_conversation_display_name(stream_interactor, conversation));
}
- 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);
+ 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);
+ set_subtitle(subject != "" ? subject : null);
+ } else {
+ set_subtitle(null);
}
}
}
diff --git a/main/src/ui/util/helper.vala b/main/src/ui/util/helper.vala
index e2c8840f..e51b8344 100644
--- a/main/src/ui/util/helper.vala
+++ b/main/src/ui/util/helper.vala
@@ -61,7 +61,7 @@ public static string get_conversation_display_name(StreamInteractor stream_inter
public static string get_display_name(StreamInteractor stream_interactor, Jid jid, Account account) {
if (stream_interactor.get_module(MucManager.IDENTITY).is_groupchat(jid, account)) {
string room_name = stream_interactor.get_module(MucManager.IDENTITY).get_room_name(account, jid);
- if (room_name != null) {
+ if (room_name != null && room_name != jid.localpart) {
return room_name;
}
return jid.bare_jid.to_string();