From 1559a7a60370c2aa0203e5c4222def4ae3258006 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Tue, 7 Feb 2023 20:03:58 +0100 Subject: Show "Me" instead of bare jid when no local alias is set --- libdino/src/util/display_name.vala | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'libdino/src') 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; -- cgit v1.2.3-70-g09d2