change equality test of Mute list to regular expression

pull/639/head
David Kaspar 2023-10-09 13:13:10 +02:00
rodzic ac0fbc7435
commit 071df0b6d3
2 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -13,12 +13,14 @@ import com.vitorpamplona.quartz.utils.TimeUtils
class HomeConversationsFeedFilter(val account: Account) : AdditiveFeedFilter<Note>() {
private val regex = ("30000:[a-f0-9]+:" + PeopleListEvent.blockList).toRegex(RegexOption.IGNORE_CASE)
override fun feedKey(): String {
return account.userProfile().pubkeyHex + "-" + account.defaultHomeFollowList
}
override fun showHiddenKey(): Boolean {
return account.defaultHomeFollowList.endsWith(PeopleListEvent.blockList)
return regex.matches(account.defaultHomeFollowList)
}
override fun feed(): List<Note> {

Wyświetl plik

@ -17,12 +17,15 @@ import com.vitorpamplona.quartz.events.TextNoteEvent
import com.vitorpamplona.quartz.utils.TimeUtils
class HomeNewThreadFeedFilter(val account: Account) : AdditiveFeedFilter<Note>() {
private val regex = ("30000:[a-f0-9]+:" + PeopleListEvent.blockList).toRegex(RegexOption.IGNORE_CASE)
override fun feedKey(): String {
return account.userProfile().pubkeyHex + "-" + account.defaultHomeFollowList
}
override fun showHiddenKey(): Boolean {
return account.defaultHomeFollowList.endsWith(PeopleListEvent.blockList)
return regex.matches(account.defaultHomeFollowList)
}
override fun feed(): List<Note> {