aboutsummaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
Diffstat (limited to 'main/src')
-rw-r--r--main/src/ui/util/helper.vala9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/src/ui/util/helper.vala b/main/src/ui/util/helper.vala
index ecfe87a8..406a879e 100644
--- a/main/src/ui/util/helper.vala
+++ b/main/src/ui/util/helper.vala
@@ -79,7 +79,6 @@ public static string get_display_name(StreamInteractor stream_interactor, Jid ji
return builder.str;
}
}
- return jid.bare_jid.to_string();
} else if (stream_interactor.get_module(MucManager.IDENTITY).is_groupchat_occupant(jid, account)) {
return jid.resourcepart;
} else {
@@ -94,7 +93,13 @@ 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 fallback_to_localpart ? jid.localpart : jid.bare_jid.to_string();
+ }
+
+ // Fallback to bare_jid / localpart
+ if (fallback_to_localpart && jid.localpart != null) {
+ return jid.localpart;
+ } else {
+ return jid.bare_jid.to_string();
}
}