mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-17 12:18:25 +00:00
Use snodes returned in 421 response
This commit is contained in:
parent
b798f49512
commit
75ce0f056c
@ -317,8 +317,20 @@ object SnodeAPI {
|
||||
421 -> {
|
||||
// The snode isn't associated with the given public key anymore
|
||||
if (publicKey != null) {
|
||||
Log.d("Loki", "Invalidating swarm for: $publicKey.")
|
||||
dropSnodeFromSwarmIfNeeded(snode, publicKey)
|
||||
fun invalidateSwarm() {
|
||||
Log.d("Loki", "Invalidating swarm for: $publicKey.")
|
||||
dropSnodeFromSwarmIfNeeded(snode, publicKey)
|
||||
}
|
||||
if (json != null) {
|
||||
val snodes = parseSnodes(json)
|
||||
if (snodes.isNotEmpty()) {
|
||||
database.setSwarm(publicKey, snodes.toSet())
|
||||
} else {
|
||||
invalidateSwarm()
|
||||
}
|
||||
} else {
|
||||
invalidateSwarm()
|
||||
}
|
||||
} else {
|
||||
Log.d("Loki", "Got a 421 without an associated public key.")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user