aboutsummaryrefslogtreecommitdiff
path: root/libdino
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2023-02-07 20:03:58 +0100
committerMarvin W <git@larma.de>2023-02-07 20:23:51 +0100
commit1559a7a60370c2aa0203e5c4222def4ae3258006 (patch)
tree21852d92178cbe8b14409f22baa38776c3b5ac9a /libdino
parentd092473fe401a5a668e57f054efbd1e84ac6ca59 (diff)
downloaddino-1559a7a60370c2aa0203e5c4222def4ae3258006.tar.gz
dino-1559a7a60370c2aa0203e5c4222def4ae3258006.zip
Show "Me" instead of bare jid when no local alias is set
Diffstat (limited to 'libdino')
-rw-r--r--libdino/src/util/display_name.vala9
1 files changed, 1 insertions, 8 deletions
diff --git a/libdino/src/util/display_name.vala b/libdino/src/util/display_name.vala
index d99bc40b..b591eb0a 100644
--- a/libdino/src/util/display_name.vala
+++ b/libdino/src/util/display_name.vala
@@ -20,13 +20,6 @@ namespace Dino {
}
public static string get_participant_display_name(StreamInteractor stream_interactor, Conversation conversation, Jid participant, string? self_word = null) {
- if (self_word != null) {
- if (conversation.account.bare_jid.equals_bare(participant) ||
- (conversation.type_ == Conversation.Type.GROUPCHAT || conversation.type_ == Conversation.Type.GROUPCHAT_PM) &&
- conversation.nickname != null && participant.equals_bare(conversation.counterpart) && conversation.nickname == participant.resourcepart) {
- return self_word;
- }
- }
if (conversation.type_ == Conversation.Type.CHAT) {
return get_real_display_name(stream_interactor, conversation.account, participant, self_word) ?? participant.bare_jid.to_string();
}
@@ -38,7 +31,7 @@ namespace Dino {
public static string? get_real_display_name(StreamInteractor stream_interactor, Account account, Jid jid, string? self_word = null) {
if (jid.equals_bare(account.bare_jid)) {
- if (self_word != null || account.alias == null || account.alias.length == 0) {
+ if (self_word != null && (account.alias == null || account.alias.length == 0)) {
return self_word;
}
return account.alias;