diff options
author | Marvin W <git@larma.de> | 2023-02-07 20:03:58 +0100 |
---|---|---|
committer | Marvin W <git@larma.de> | 2023-02-07 20:23:51 +0100 |
commit | 1559a7a60370c2aa0203e5c4222def4ae3258006 (patch) | |
tree | 21852d92178cbe8b14409f22baa38776c3b5ac9a | |
parent | d092473fe401a5a668e57f054efbd1e84ac6ca59 (diff) | |
download | dino-1559a7a60370c2aa0203e5c4222def4ae3258006.tar.gz dino-1559a7a60370c2aa0203e5c4222def4ae3258006.zip |
Show "Me" instead of bare jid when no local alias is set
-rw-r--r-- | libdino/src/util/display_name.vala | 9 | ||||
-rw-r--r-- | main/src/ui/conversation_content_view/conversation_item_skeleton.vala | 2 |
2 files changed, 2 insertions, 9 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; diff --git a/main/src/ui/conversation_content_view/conversation_item_skeleton.vala b/main/src/ui/conversation_content_view/conversation_item_skeleton.vala index bd3b8555..96cb6c3d 100644 --- a/main/src/ui/conversation_content_view/conversation_item_skeleton.vala +++ b/main/src/ui/conversation_content_view/conversation_item_skeleton.vala @@ -181,7 +181,7 @@ public class ConversationItemSkeleton : Plugins.ConversationItemWidgetInterface, } private void update_name_label() { - name_label.label = Util.get_participant_display_name(stream_interactor, conversation, item.jid); + name_label.label = Util.get_participant_display_name(stream_interactor, conversation, item.jid, true); } private void update_received_mark() { |