mirror of
https://github.com/LiveFastEatTrashRaccoon/RaccoonForLemmy.git
synced 2025-02-03 14:07:45 +01:00
fix: more lemmy 0.19 breaking changes (#192)
This commit is contained in:
parent
5b89911375
commit
2a31369894
@ -5,7 +5,7 @@ import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class LocalSiteRateLimit(
|
||||
@SerialName("id") val id: Int,
|
||||
@SerialName("id") val id: Int? = null,
|
||||
@SerialName("local_site_id") val localSiteId: LocalSiteId,
|
||||
@SerialName("message") val message: Int,
|
||||
@SerialName("message_per_second") val messagePerSecond: Int,
|
||||
|
@ -8,19 +8,19 @@ data class LocalUser(
|
||||
@SerialName("id") val id: LocalUserId,
|
||||
@SerialName("person_id") val personId: PersonId,
|
||||
@SerialName("email") val email: String? = null,
|
||||
@SerialName("show_nsfw") val showNsfw: Boolean,
|
||||
@SerialName("theme") val theme: String,
|
||||
@SerialName("default_sort_type") val defaultSortType: SortType,
|
||||
@SerialName("default_listing_type") val defaultListingType: ListingType,
|
||||
@SerialName("interface_language") val interfaceLanguage: String,
|
||||
@SerialName("show_avatars") val showAvatars: Boolean,
|
||||
@SerialName("send_notifications_to_email") val sendNotificationsToEmail: Boolean,
|
||||
@SerialName("validator_time") val validatorTime: String,
|
||||
@SerialName("show_scores") val showScores: Boolean,
|
||||
@SerialName("show_bot_accounts") val showBotAccounts: Boolean,
|
||||
@SerialName("show_read_posts") val showReadPosts: Boolean,
|
||||
@SerialName("show_new_post_notifs") val showNewPostNotifs: Boolean,
|
||||
@SerialName("email_verified") val emailVerified: Boolean,
|
||||
@SerialName("accepted_application") val acceptedApplication: Boolean,
|
||||
@SerialName("show_nsfw") val showNsfw: Boolean? = null,
|
||||
@SerialName("theme") val theme: String? = null,
|
||||
@SerialName("default_sort_type") val defaultSortType: SortType? = null,
|
||||
@SerialName("default_listing_type") val defaultListingType: ListingType? = null,
|
||||
@SerialName("interface_language") val interfaceLanguage: String? = null,
|
||||
@SerialName("show_avatars") val showAvatars: Boolean? = null,
|
||||
@SerialName("send_notifications_to_email") val sendNotificationsToEmail: Boolean? = null,
|
||||
@SerialName("validator_time") val validatorTime: String? = null,
|
||||
@SerialName("show_scores") val showScores: Boolean? = null,
|
||||
@SerialName("show_bot_accounts") val showBotAccounts: Boolean? = null,
|
||||
@SerialName("show_read_posts") val showReadPosts: Boolean? = null,
|
||||
@SerialName("show_new_post_notifs") val showNewPostNotifs: Boolean? = null,
|
||||
@SerialName("email_verified") val emailVerified: Boolean? = null,
|
||||
@SerialName("accepted_application") val acceptedApplication: Boolean? = null,
|
||||
@SerialName("totp_2fa_url") val totp2faUrl: String? = null,
|
||||
)
|
||||
|
@ -5,7 +5,7 @@ import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class LocalUserView(
|
||||
@SerialName("local_user") val localUser: LocalUser,
|
||||
@SerialName("local_user") val localUser: LocalUser? = null,
|
||||
@SerialName("person") val person: Person,
|
||||
@SerialName("counts") val counts: PersonAggregates,
|
||||
)
|
||||
|
@ -5,10 +5,10 @@ import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class MyUserInfo(
|
||||
@SerialName("local_user_view") val localUserView: LocalUserView,
|
||||
@SerialName("follows") val follows: List<CommunityFollowerView>,
|
||||
@SerialName("moderates") val moderates: List<CommunityModeratorView>,
|
||||
@SerialName("community_blocks") val communityBlocks: List<CommunityBlockView>,
|
||||
@SerialName("person_blocks") val personBlocks: List<PersonBlockView>,
|
||||
@SerialName("discussion_languages") val discussionLanguages: List<LanguageId>,
|
||||
@SerialName("local_user_view") val localUserView: LocalUserView? = null,
|
||||
@SerialName("follows") val follows: List<CommunityFollowerView> = emptyList(),
|
||||
@SerialName("moderates") val moderates: List<CommunityModeratorView> = emptyList(),
|
||||
@SerialName("community_blocks") val communityBlocks: List<CommunityBlockView> = emptyList(),
|
||||
@SerialName("person_blocks") val personBlocks: List<PersonBlockView> = emptyList(),
|
||||
@SerialName("discussion_languages") val discussionLanguages: List<LanguageId> = emptyList(),
|
||||
)
|
||||
|
@ -17,9 +17,9 @@ class SiteRepository(
|
||||
authHeader = auth.toAuthHeader(),
|
||||
).body()
|
||||
dto?.myUser?.let {
|
||||
val user = it.localUserView.person
|
||||
val counts = it.localUserView.counts
|
||||
user.toModel().copy(score = counts.toModel())
|
||||
val user = it.localUserView?.person
|
||||
val counts = it.localUserView?.counts
|
||||
user?.toModel()?.copy(score = counts?.toModel())
|
||||
}
|
||||
}.getOrNull()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user