mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-11 10:13:12 +02:00
Updating all user's relays when new ContactLists arrive
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package com.vitorpamplona.amethyst.model
|
package com.vitorpamplona.amethyst.model
|
||||||
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.util.LruCache
|
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import com.fasterxml.jackson.databind.DeserializationFeature
|
import com.fasterxml.jackson.databind.DeserializationFeature
|
||||||
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
||||||
@@ -24,8 +23,6 @@ import java.time.ZoneId
|
|||||||
import java.time.format.DateTimeFormatter
|
import java.time.format.DateTimeFormatter
|
||||||
import java.util.concurrent.ConcurrentHashMap
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
import java.util.concurrent.atomic.AtomicBoolean
|
import java.util.concurrent.atomic.AtomicBoolean
|
||||||
import kotlin.time.ExperimentalTime
|
|
||||||
import kotlin.time.measureTimedValue
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
@@ -227,7 +224,6 @@ object LocalCache {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Saves relay list only if it's a user that is currently been seen
|
// Saves relay list only if it's a user that is currently been seen
|
||||||
if (user.liveSet?.isInUse() == true) {
|
|
||||||
try {
|
try {
|
||||||
if (event.content.isNotEmpty()) {
|
if (event.content.isNotEmpty()) {
|
||||||
val relays: Map<String, ContactListEvent.ReadWrite> =
|
val relays: Map<String, ContactListEvent.ReadWrite> =
|
||||||
@@ -239,9 +235,9 @@ object LocalCache {
|
|||||||
user.updateRelays(relays)
|
user.updateRelays(relays)
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
println("relay import issue")
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Log.d(
|
Log.d(
|
||||||
"CL",
|
"CL",
|
||||||
|
Reference in New Issue
Block a user