aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2018-12-28 13:35:52 +0100
committerfiaxh <git@lightrise.org>2018-12-28 13:43:19 +0100
commit1014b696f2cb6103968ee24ae7f32472e37085a0 (patch)
treecfca9830c056c260675d66983f8182f0f62808a9
parentd8e0ab406cdad73edf79123e84d0013b96a3963a (diff)
downloaddino-1014b696f2cb6103968ee24ae7f32472e37085a0.tar.gz
dino-1014b696f2cb6103968ee24ae7f32472e37085a0.zip
Private MUCs w/o name: Display localparts instead of barejids if name is not known
-rw-r--r--main/src/ui/util/helper.vala6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/src/ui/util/helper.vala b/main/src/ui/util/helper.vala
index da854513..5e5988a1 100644
--- a/main/src/ui/util/helper.vala
+++ b/main/src/ui/util/helper.vala
@@ -58,7 +58,7 @@ public static string get_conversation_display_name(StreamInteractor stream_inter
return get_display_name(stream_interactor, conversation.counterpart, conversation.account);
}
-public static string get_display_name(StreamInteractor stream_interactor, Jid jid, Account account) {
+public static string get_display_name(StreamInteractor stream_interactor, Jid jid, Account account, bool fallback_to_localpart = false) {
if (stream_interactor.get_module(MucManager.IDENTITY).is_groupchat(jid, account)) {
MucManager muc_manager = stream_interactor.get_module(MucManager.IDENTITY);
string room_name = muc_manager.get_room_name(account, jid);
@@ -74,7 +74,7 @@ public static string get_display_name(StreamInteractor stream_interactor, Jid ji
if (builder.len != 0) {
builder.append(", ");
}
- builder.append(get_display_name(stream_interactor, occupant, account).split(" ")[0]);
+ builder.append(get_display_name(stream_interactor, occupant, account, true).split(" ")[0]);
}
return builder.str;
}
@@ -94,7 +94,7 @@ public static string get_display_name(StreamInteractor stream_interactor, Jid ji
if (roster_item != null && roster_item.name != null && roster_item.name != "") {
return roster_item.name;
}
- return jid.bare_jid.to_string();
+ return fallback_to_localpart ? jid.localpart : jid.bare_jid.to_string();
}
}