From 6c13fde3e3228e9a2192b8470186da0650d97b81 Mon Sep 17 00:00:00 2001 From: Yuichiro Kinoshita Date: Mon, 6 Nov 2023 15:22:50 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=80=E9=83=A8=E3=81=AE=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=81=AEMisskey=E3=81=A7?= =?UTF-8?q?=E3=81=86=E3=81=BE=E3=81=8F=E5=8B=95=E4=BD=9C=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=8F=E3=81=AA=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/net/pantasystem/milktea/api/misskey/users/UserDTO.kt | 2 +- .../milktea/data/converters/UserDTOEntityConverter.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/api/src/main/java/net/pantasystem/milktea/api/misskey/users/UserDTO.kt b/modules/api/src/main/java/net/pantasystem/milktea/api/misskey/users/UserDTO.kt index 7b2c1cb67d..c4dbdaf522 100644 --- a/modules/api/src/main/java/net/pantasystem/milktea/api/misskey/users/UserDTO.kt +++ b/modules/api/src/main/java/net/pantasystem/milktea/api/misskey/users/UserDTO.kt @@ -173,6 +173,6 @@ data class UserDTO( val iconUrl: String?, @SerialName("displayOrder") - val displayOrder: Int, + val displayOrder: Int? = null, ) } diff --git a/modules/data/src/main/java/net/pantasystem/milktea/data/converters/UserDTOEntityConverter.kt b/modules/data/src/main/java/net/pantasystem/milktea/data/converters/UserDTOEntityConverter.kt index 5c4e442d95..0dee1775d2 100644 --- a/modules/data/src/main/java/net/pantasystem/milktea/data/converters/UserDTOEntityConverter.kt +++ b/modules/data/src/main/java/net/pantasystem/milktea/data/converters/UserDTOEntityConverter.kt @@ -60,11 +60,11 @@ class UserDTOEntityConverter @Inject constructor( it.name to it.host to it.url to it.uri } - val badgeRoles = userDTO.badgeRoles?.map { role -> + val badgeRoles = userDTO.badgeRoles?.mapIndexed { index, role -> User.BadgeRole( name = role.name, iconUri = role.iconUrl, - displayOrder = role.displayOrder + displayOrder = role.displayOrder ?: ((userDTO.badgeRoles?.size ?: 0) - index) ) }?.sortedByDescending { it.displayOrder