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