mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 12:08:34 +02:00
Faster processing of Contact List events
This commit is contained in:
@@ -302,12 +302,10 @@ object LocalCache {
|
|||||||
|
|
||||||
fun consume(event: ContactListEvent) {
|
fun consume(event: ContactListEvent) {
|
||||||
val user = getOrCreateUser(event.pubKey)
|
val user = getOrCreateUser(event.pubKey)
|
||||||
val follows = event.unverifiedFollowKeySet()
|
|
||||||
|
|
||||||
if (event.createdAt > (user.latestContactList?.createdAt ?: 0) && !follows.isNullOrEmpty()) {
|
// avoids processing empty contact lists.
|
||||||
// Saves relay list only if it's a user that is currently been seen
|
if (event.createdAt > (user.latestContactList?.createdAt ?: 0) && !event.tags.isEmpty()) {
|
||||||
user.updateContactList(event)
|
user.updateContactList(event)
|
||||||
|
|
||||||
// Log.d("CL", "AAA ${user.toBestDisplayName()} ${follows.size}")
|
// Log.d("CL", "AAA ${user.toBestDisplayName()} ${follows.size}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user