From cf642d9eb0e6eae6ffec9e7c8d21927b5bd2fc7a Mon Sep 17 00:00:00 2001 From: kyori19 Date: Sat, 6 Mar 2021 00:26:51 +0900 Subject: [PATCH] Avoid using displayName for displaying purpose (#2101) --- .../tusky/components/conversation/ConversationEntity.kt | 2 +- .../com/keylesspalace/tusky/repository/TimelineRepository.kt | 2 +- .../main/java/com/keylesspalace/tusky/util/ViewDataUtils.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationEntity.kt b/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationEntity.kt index 8ee1a284..e35d460d 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationEntity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationEntity.kt @@ -167,7 +167,7 @@ fun Account.toEntity() = ConversationAccountEntity( id, username, - displayName.orEmpty(), + name, avatar, emojis ?: emptyList() ) diff --git a/app/src/main/java/com/keylesspalace/tusky/repository/TimelineRepository.kt b/app/src/main/java/com/keylesspalace/tusky/repository/TimelineRepository.kt index 945c55d3..b3e12aeb 100644 --- a/app/src/main/java/com/keylesspalace/tusky/repository/TimelineRepository.kt +++ b/app/src/main/java/com/keylesspalace/tusky/repository/TimelineRepository.kt @@ -298,7 +298,7 @@ fun Account.toEntity(accountId: Long, gson: Gson): TimelineAccountEntity { timelineUserId = accountId, localUsername = localUsername, username = username, - displayName = displayName.orEmpty(), + displayName = name, url = url, avatar = avatar, emojis = gson.toJson(emojis), diff --git a/app/src/main/java/com/keylesspalace/tusky/util/ViewDataUtils.java b/app/src/main/java/com/keylesspalace/tusky/util/ViewDataUtils.java index ffe64a14..2e8e67ef 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/ViewDataUtils.java +++ b/app/src/main/java/com/keylesspalace/tusky/util/ViewDataUtils.java @@ -52,7 +52,7 @@ public final class ViewDataUtils { .setSensitive(visibleStatus.getSensitive()) .setIsShowingSensitiveContent(alwaysShowSensitiveMedia || !visibleStatus.getSensitive()) .setSpoilerText(visibleStatus.getSpoilerText()) - .setRebloggedByUsername(status.getReblog() == null ? null : status.getAccount().getDisplayName()) + .setRebloggedByUsername(status.getReblog() == null ? null : status.getAccount().getName()) .setUserFullName(visibleStatus.getAccount().getName()) .setVisibility(visibleStatus.getVisibility()) .setSenderId(visibleStatus.getAccount().getId())