mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-10 15:42:53 +02:00
Apply hidden to boosted notes only.
This commit is contained in:
@@ -571,8 +571,15 @@ open class Note(val idHex: String) {
|
|||||||
fun isHiddenFor(accountChoices: Account.LiveHiddenUsers): Boolean {
|
fun isHiddenFor(accountChoices: Account.LiveHiddenUsers): Boolean {
|
||||||
if (event == null) return false
|
if (event == null) return false
|
||||||
|
|
||||||
|
val isBoostedNoteHidden = if (event is GenericRepostEvent || event is RepostEvent || event is CommunityPostApprovalEvent) {
|
||||||
|
replyTo?.lastOrNull()?.isHiddenFor(accountChoices) ?: false
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
val isSensitive = event?.isSensitive() ?: false
|
val isSensitive = event?.isSensitive() ?: false
|
||||||
return accountChoices.hiddenUsers.contains(author?.pubkeyHex) ||
|
return isBoostedNoteHidden ||
|
||||||
|
accountChoices.hiddenUsers.contains(author?.pubkeyHex) ||
|
||||||
accountChoices.spammers.contains(author?.pubkeyHex) ||
|
accountChoices.spammers.contains(author?.pubkeyHex) ||
|
||||||
(isSensitive && accountChoices.showSensitiveContent == false)
|
(isSensitive && accountChoices.showSensitiveContent == false)
|
||||||
}
|
}
|
||||||
|
@@ -291,9 +291,8 @@ fun CheckHiddenNoteCompose(
|
|||||||
nav = nav
|
nav = nav
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
val boostedNote = note.replyTo?.lastOrNull()
|
|
||||||
val isHidden by accountViewModel.account.liveHiddenUsers.map {
|
val isHidden by accountViewModel.account.liveHiddenUsers.map {
|
||||||
note.isHiddenFor(it) || boostedNote?.isHiddenFor(it) == true
|
note.isHiddenFor(it)
|
||||||
}.observeAsState(accountViewModel.isNoteHidden(note))
|
}.observeAsState(accountViewModel.isNoteHidden(note))
|
||||||
|
|
||||||
Crossfade(targetState = isHidden) {
|
Crossfade(targetState = isHidden) {
|
||||||
|
Reference in New Issue
Block a user