mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 20:39:04 +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 {
|
||||
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
|
||||
return accountChoices.hiddenUsers.contains(author?.pubkeyHex) ||
|
||||
return isBoostedNoteHidden ||
|
||||
accountChoices.hiddenUsers.contains(author?.pubkeyHex) ||
|
||||
accountChoices.spammers.contains(author?.pubkeyHex) ||
|
||||
(isSensitive && accountChoices.showSensitiveContent == false)
|
||||
}
|
||||
|
@@ -291,9 +291,8 @@ fun CheckHiddenNoteCompose(
|
||||
nav = nav
|
||||
)
|
||||
} else {
|
||||
val boostedNote = note.replyTo?.lastOrNull()
|
||||
val isHidden by accountViewModel.account.liveHiddenUsers.map {
|
||||
note.isHiddenFor(it) || boostedNote?.isHiddenFor(it) == true
|
||||
note.isHiddenFor(it)
|
||||
}.observeAsState(accountViewModel.isNoteHidden(note))
|
||||
|
||||
Crossfade(targetState = isHidden) {
|
||||
|
Reference in New Issue
Block a user