mirror of
https://github.com/LiveFastEatTrashRaccoon/RaccoonForLemmy.git
synced 2025-02-09 09:08:39 +01:00
fix: distinguish between replies to posts and comments (#427)
This commit is contained in:
parent
834396bf82
commit
547fc654e1
@ -40,10 +40,11 @@ fun InboxCardHeader(
|
||||
}
|
||||
|
||||
InboxCardType.Reply -> {
|
||||
if (mention.isOwnPost) {
|
||||
append(stringResource(MR.strings.inbox_item_reply_post))
|
||||
} else {
|
||||
if (mention.isCommentReply) {
|
||||
append(stringResource(MR.strings.inbox_item_reply_comment))
|
||||
} else {
|
||||
append(stringResource(MR.strings.inbox_item_reply_post))
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ data class PersonMentionModel(
|
||||
val downvotes: Int,
|
||||
val myVote: Int,
|
||||
val saved: Boolean,
|
||||
val isOwnPost: Boolean = false,
|
||||
val isCommentReply: Boolean = false,
|
||||
val publishDate: String? = null,
|
||||
val read: Boolean = false,
|
||||
)
|
||||
|
@ -273,12 +273,16 @@ internal fun CommentReplyView.toModel() = PersonMentionModel(
|
||||
upvotes = counts.upvotes,
|
||||
downvotes = counts.downvotes,
|
||||
community = community.toModel(),
|
||||
creator = creator.toModel(),
|
||||
saved = saved,
|
||||
myVote = myVote ?: 0,
|
||||
),
|
||||
comment = comment.toModel().copy(
|
||||
score = counts.score,
|
||||
upvotes = counts.upvotes,
|
||||
downvotes = counts.downvotes,
|
||||
community = community.toModel(),
|
||||
saved = saved,
|
||||
myVote = myVote ?: 0,
|
||||
),
|
||||
creator = creator.toModel(),
|
||||
community = community.toModel(),
|
||||
|
@ -139,7 +139,9 @@ class InboxMentionsViewModel(
|
||||
page = currentPage,
|
||||
unreadOnly = unreadOnly,
|
||||
sort = SortType.New,
|
||||
)
|
||||
)?.map {
|
||||
it.copy(isCommentReply = it.comment.depth > 0)
|
||||
}
|
||||
if (!itemList.isNullOrEmpty()) {
|
||||
currentPage++
|
||||
}
|
||||
|
@ -146,8 +146,7 @@ class InboxRepliesViewModel(
|
||||
unreadOnly = unreadOnly,
|
||||
sort = SortType.New,
|
||||
)?.map {
|
||||
val isOwnPost = it.post.creator?.id == currentUserId
|
||||
it.copy(isOwnPost = isOwnPost)
|
||||
it.copy(isCommentReply = it.comment.depth > 0)
|
||||
}
|
||||
|
||||
if (!itemList.isNullOrEmpty()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user