Decreasing the speed of the updates of the feed.
This commit is contained in:
@@ -742,7 +742,7 @@ class LocalCacheLiveData(val cache: LocalCache): LiveData<LocalCacheState>(Local
|
|||||||
val scope = CoroutineScope(Job() + Dispatchers.Main)
|
val scope = CoroutineScope(Job() + Dispatchers.Main)
|
||||||
scope.launch {
|
scope.launch {
|
||||||
try {
|
try {
|
||||||
delay(100)
|
delay(500)
|
||||||
refresh()
|
refresh()
|
||||||
} finally {
|
} finally {
|
||||||
withContext(NonCancellable) {
|
withContext(NonCancellable) {
|
||||||
|
|||||||
@@ -370,7 +370,7 @@ class UserMetadata {
|
|||||||
|
|
||||||
fun anyNameStartsWith(prefix: String): Boolean {
|
fun anyNameStartsWith(prefix: String): Boolean {
|
||||||
return listOfNotNull(name, username, display_name, displayName, nip05, lud06, lud16)
|
return listOfNotNull(name, username, display_name, displayName, nip05, lud06, lud16)
|
||||||
.filter { it.startsWith(prefix, true) }.isNotEmpty()
|
.any { it.startsWith(prefix, true) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.vitorpamplona.amethyst.service
|
package com.vitorpamplona.amethyst.service
|
||||||
|
|
||||||
import com.vitorpamplona.amethyst.model.Account
|
|
||||||
import com.vitorpamplona.amethyst.service.model.ChannelMessageEvent
|
import com.vitorpamplona.amethyst.service.model.ChannelMessageEvent
|
||||||
import com.vitorpamplona.amethyst.service.relays.FeedType
|
import com.vitorpamplona.amethyst.service.relays.FeedType
|
||||||
import com.vitorpamplona.amethyst.service.relays.TypedFilter
|
import com.vitorpamplona.amethyst.service.relays.TypedFilter
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ object GlobalFeedFilter: FeedFilter<Note>() {
|
|||||||
lateinit var account: Account
|
lateinit var account: Account
|
||||||
|
|
||||||
override fun feed() = LocalCache.notes.values
|
override fun feed() = LocalCache.notes.values
|
||||||
.filter { account.isAcceptable(it) }
|
|
||||||
.filter {
|
.filter {
|
||||||
(it.event is TextNoteEvent && (it.event as TextNoteEvent).replyTos.isEmpty()) ||
|
(it.event is TextNoteEvent && (it.event as TextNoteEvent).replyTos.isEmpty()) ||
|
||||||
(it.event is ChannelMessageEvent && (it.event as ChannelMessageEvent).replyTos.isEmpty())
|
(it.event is ChannelMessageEvent && (it.event as ChannelMessageEvent).replyTos.isEmpty())
|
||||||
}
|
}
|
||||||
|
.filter { account.isAcceptable(it) }
|
||||||
.sortedBy { it.event?.createdAt }
|
.sortedBy { it.event?.createdAt }
|
||||||
.reversed()
|
.reversed()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user