mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-06-21 06:21:14 +02:00
change equality test of Mute list to regular expression
This commit is contained in:
parent
ac0fbc7435
commit
071df0b6d3
@ -13,12 +13,14 @@ import com.vitorpamplona.quartz.utils.TimeUtils
|
|||||||
|
|
||||||
class HomeConversationsFeedFilter(val account: Account) : AdditiveFeedFilter<Note>() {
|
class HomeConversationsFeedFilter(val account: Account) : AdditiveFeedFilter<Note>() {
|
||||||
|
|
||||||
|
private val regex = ("30000:[a-f0-9]+:" + PeopleListEvent.blockList).toRegex(RegexOption.IGNORE_CASE)
|
||||||
|
|
||||||
override fun feedKey(): String {
|
override fun feedKey(): String {
|
||||||
return account.userProfile().pubkeyHex + "-" + account.defaultHomeFollowList
|
return account.userProfile().pubkeyHex + "-" + account.defaultHomeFollowList
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun showHiddenKey(): Boolean {
|
override fun showHiddenKey(): Boolean {
|
||||||
return account.defaultHomeFollowList.endsWith(PeopleListEvent.blockList)
|
return regex.matches(account.defaultHomeFollowList)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun feed(): List<Note> {
|
override fun feed(): List<Note> {
|
||||||
|
@ -17,12 +17,15 @@ import com.vitorpamplona.quartz.events.TextNoteEvent
|
|||||||
import com.vitorpamplona.quartz.utils.TimeUtils
|
import com.vitorpamplona.quartz.utils.TimeUtils
|
||||||
|
|
||||||
class HomeNewThreadFeedFilter(val account: Account) : AdditiveFeedFilter<Note>() {
|
class HomeNewThreadFeedFilter(val account: Account) : AdditiveFeedFilter<Note>() {
|
||||||
|
|
||||||
|
private val regex = ("30000:[a-f0-9]+:" + PeopleListEvent.blockList).toRegex(RegexOption.IGNORE_CASE)
|
||||||
|
|
||||||
override fun feedKey(): String {
|
override fun feedKey(): String {
|
||||||
return account.userProfile().pubkeyHex + "-" + account.defaultHomeFollowList
|
return account.userProfile().pubkeyHex + "-" + account.defaultHomeFollowList
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun showHiddenKey(): Boolean {
|
override fun showHiddenKey(): Boolean {
|
||||||
return account.defaultHomeFollowList.endsWith(PeopleListEvent.blockList)
|
return regex.matches(account.defaultHomeFollowList)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun feed(): List<Note> {
|
override fun feed(): List<Note> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user