mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-26 17:52:29 +01:00
simple refactoring
This commit is contained in:
parent
56bc10b513
commit
26356d6060
@ -95,17 +95,12 @@ class NotificationFeedFilter(val account: Account) : AdditiveFeedFilter<Note>()
|
||||
val event = note.event
|
||||
|
||||
if (event is BaseTextNoteEvent) {
|
||||
val isAuthoredPostCited =
|
||||
event.findCitations().any {
|
||||
LocalCache.notes[it]?.author?.pubkeyHex == authorHex ||
|
||||
LocalCache.addressables[it]?.author?.pubkeyHex == authorHex
|
||||
}
|
||||
if (note.replyTo?.any { it.author?.pubkeyHex == authorHex } == true) return true
|
||||
|
||||
return isAuthoredPostCited ||
|
||||
(
|
||||
event.citedUsers().contains(authorHex) ||
|
||||
note.replyTo?.any { it.author?.pubkeyHex == authorHex } == true
|
||||
)
|
||||
val isAuthoredPostCited = event.findCitations().any { LocalCache.getNoteIfExists(it)?.author?.pubkeyHex == authorHex }
|
||||
val isAuthorDirectlyCited = event.citedUsers().contains(authorHex)
|
||||
|
||||
return isAuthoredPostCited || isAuthorDirectlyCited
|
||||
}
|
||||
|
||||
if (event is ReactionEvent) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user