simple refactoring
This commit is contained in:
@@ -95,17 +95,12 @@ class NotificationFeedFilter(val account: Account) : AdditiveFeedFilter<Note>()
|
|||||||
val event = note.event
|
val event = note.event
|
||||||
|
|
||||||
if (event is BaseTextNoteEvent) {
|
if (event is BaseTextNoteEvent) {
|
||||||
val isAuthoredPostCited =
|
if (note.replyTo?.any { it.author?.pubkeyHex == authorHex } == true) return true
|
||||||
event.findCitations().any {
|
|
||||||
LocalCache.notes[it]?.author?.pubkeyHex == authorHex ||
|
|
||||||
LocalCache.addressables[it]?.author?.pubkeyHex == authorHex
|
|
||||||
}
|
|
||||||
|
|
||||||
return isAuthoredPostCited ||
|
val isAuthoredPostCited = event.findCitations().any { LocalCache.getNoteIfExists(it)?.author?.pubkeyHex == authorHex }
|
||||||
(
|
val isAuthorDirectlyCited = event.citedUsers().contains(authorHex)
|
||||||
event.citedUsers().contains(authorHex) ||
|
|
||||||
note.replyTo?.any { it.author?.pubkeyHex == authorHex } == true
|
return isAuthoredPostCited || isAuthorDirectlyCited
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event is ReactionEvent) {
|
if (event is ReactionEvent) {
|
||||||
|
|||||||
Reference in New Issue
Block a user