mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-30 21:42:54 +02:00
solve recursive method call
This commit is contained in:
@@ -9,17 +9,17 @@ object GlobalFeedFilter : AdditiveFeedFilter<Note>() {
|
||||
lateinit var account: Account
|
||||
|
||||
override fun feed(): List<Note> {
|
||||
val notes = applyFilter(LocalCache.notes.values)
|
||||
val longFormNotes = applyFilter(LocalCache.addressables.values)
|
||||
val notes = innerApplyFilter(LocalCache.notes.values)
|
||||
val longFormNotes = innerApplyFilter(LocalCache.addressables.values)
|
||||
|
||||
return sort(notes + longFormNotes)
|
||||
}
|
||||
|
||||
override fun applyFilter(collection: Set<Note>): List<Note> {
|
||||
return applyFilter(collection)
|
||||
return innerApplyFilter(collection)
|
||||
}
|
||||
|
||||
private fun applyFilter(collection: Collection<Note>): List<Note> {
|
||||
private fun innerApplyFilter(collection: Collection<Note>): List<Note> {
|
||||
val followChannels = account.followingChannels
|
||||
val followUsers = account.followingKeySet()
|
||||
val now = System.currentTimeMillis() / 1000
|
||||
|
@@ -18,14 +18,14 @@ object HashtagFeedFilter : AdditiveFeedFilter<Note>() {
|
||||
}
|
||||
|
||||
override fun feed(): List<Note> {
|
||||
return sort(applyFilter(LocalCache.notes.values))
|
||||
return sort(innerApplyFilter(LocalCache.notes.values))
|
||||
}
|
||||
|
||||
override fun applyFilter(collection: Set<Note>): List<Note> {
|
||||
return applyFilter(collection)
|
||||
}
|
||||
|
||||
private fun applyFilter(collection: Collection<Note>): List<Note> {
|
||||
private fun innerApplyFilter(collection: Collection<Note>): List<Note> {
|
||||
val myTag = tag ?: return emptyList()
|
||||
|
||||
return collection
|
||||
|
@@ -10,14 +10,14 @@ object HomeConversationsFeedFilter : AdditiveFeedFilter<Note>() {
|
||||
lateinit var account: Account
|
||||
|
||||
override fun feed(): List<Note> {
|
||||
return sort(applyFilter(LocalCache.notes.values))
|
||||
return sort(innerApplyFilter(LocalCache.notes.values))
|
||||
}
|
||||
|
||||
override fun applyFilter(collection: Set<Note>): List<Note> {
|
||||
return applyFilter(collection)
|
||||
return innerApplyFilter(collection)
|
||||
}
|
||||
|
||||
private fun applyFilter(collection: Collection<Note>): List<Note> {
|
||||
private fun innerApplyFilter(collection: Collection<Note>): List<Note> {
|
||||
val user = account.userProfile()
|
||||
val followingKeySet = user.cachedFollowingKeySet()
|
||||
val followingTagSet = user.cachedFollowingTagSet()
|
||||
|
@@ -12,17 +12,17 @@ object HomeNewThreadFeedFilter : AdditiveFeedFilter<Note>() {
|
||||
lateinit var account: Account
|
||||
|
||||
override fun feed(): List<Note> {
|
||||
val notes = applyFilter(LocalCache.notes.values)
|
||||
val longFormNotes = applyFilter(LocalCache.addressables.values)
|
||||
val notes = innerApplyFilter(LocalCache.notes.values)
|
||||
val longFormNotes = innerApplyFilter(LocalCache.addressables.values)
|
||||
|
||||
return sort(notes + longFormNotes)
|
||||
}
|
||||
|
||||
override fun applyFilter(collection: Set<Note>): List<Note> {
|
||||
return applyFilter(collection)
|
||||
return innerApplyFilter(collection)
|
||||
}
|
||||
|
||||
private fun applyFilter(collection: Collection<Note>): List<Note> {
|
||||
private fun innerApplyFilter(collection: Collection<Note>): List<Note> {
|
||||
val user = account.userProfile()
|
||||
val followingKeySet = user.cachedFollowingKeySet()
|
||||
val followingTagSet = user.cachedFollowingTagSet()
|
||||
|
@@ -10,14 +10,14 @@ object NotificationFeedFilter : AdditiveFeedFilter<Note>() {
|
||||
lateinit var account: Account
|
||||
|
||||
override fun feed(): List<Note> {
|
||||
return sort(applyFilter(LocalCache.notes.values))
|
||||
return sort(innerApplyFilter(LocalCache.notes.values))
|
||||
}
|
||||
|
||||
override fun applyFilter(collection: Set<Note>): List<Note> {
|
||||
return applyFilter(collection)
|
||||
return innerApplyFilter(collection)
|
||||
}
|
||||
|
||||
private fun applyFilter(collection: Collection<Note>): List<Note> {
|
||||
private fun innerApplyFilter(collection: Collection<Note>): List<Note> {
|
||||
val loggedInUser = account.userProfile()
|
||||
val loggedInUserHex = loggedInUser.pubkeyHex
|
||||
|
||||
|
Reference in New Issue
Block a user