Deletes hiddenUsers method from account to avoid misuse since it needs a blocking load from cache.
This commit is contained in:
@@ -89,10 +89,6 @@ class Account(
|
|||||||
return followingChannels.map { LocalCache.getOrCreateChannel(it) }
|
return followingChannels.map { LocalCache.getOrCreateChannel(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hiddenUsers(): List<User> {
|
|
||||||
return (hiddenUsers + transientHiddenUsers).map { LocalCache.getOrCreateUser(it) }
|
|
||||||
}
|
|
||||||
|
|
||||||
fun isWriteable(): Boolean {
|
fun isWriteable(): Boolean {
|
||||||
return loggedIn.privKey != null
|
return loggedIn.privKey != null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
package com.vitorpamplona.amethyst.ui.dal
|
package com.vitorpamplona.amethyst.ui.dal
|
||||||
|
|
||||||
import com.vitorpamplona.amethyst.model.Account
|
import com.vitorpamplona.amethyst.model.Account
|
||||||
|
import com.vitorpamplona.amethyst.model.LocalCache
|
||||||
import com.vitorpamplona.amethyst.model.User
|
import com.vitorpamplona.amethyst.model.User
|
||||||
|
|
||||||
class HiddenAccountsFeedFilter(val account: Account) : FeedFilter<User>() {
|
class HiddenAccountsFeedFilter(val account: Account) : FeedFilter<User>() {
|
||||||
|
|
||||||
override fun feed() = account.hiddenUsers()
|
override fun feed(): List<User> {
|
||||||
|
return (account.hiddenUsers + account.transientHiddenUsers)
|
||||||
|
.map { LocalCache.getOrCreateUser(it) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user