fix: use contact information as opposed to active conversations
This commit is contained in:
parent
8394ae000e
commit
128df56545
|
@ -1533,16 +1533,12 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
|
||||||
if (mapping.sessionId != null) {
|
if (mapping.sessionId != null) {
|
||||||
return mapping
|
return mapping
|
||||||
}
|
}
|
||||||
val threadDb = DatabaseComponent.get(context).threadDatabase()
|
getAllContacts().forEach { contact ->
|
||||||
threadDb.readerFor(threadDb.conversationList).use { reader ->
|
val sessionId = SessionId(contact.sessionID)
|
||||||
while (reader.next != null) {
|
if (sessionId.prefix == IdPrefix.STANDARD && SodiumUtilities.sessionId(sessionId.hexString, blindedId, serverPublicKey)) {
|
||||||
val recipient = reader.current.recipient
|
val contactMapping = mapping.copy(sessionId = sessionId.hexString)
|
||||||
val sessionId = recipient.address.serialize()
|
db.addBlindedIdMapping(contactMapping)
|
||||||
if (!recipient.isGroupRecipient && SodiumUtilities.sessionId(sessionId, blindedId, serverPublicKey)) {
|
return contactMapping
|
||||||
val contactMapping = mapping.copy(sessionId = sessionId)
|
|
||||||
db.addBlindedIdMapping(contactMapping)
|
|
||||||
return contactMapping
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
db.getBlindedIdMappingsExceptFor(server).forEach {
|
db.getBlindedIdMappingsExceptFor(server).forEach {
|
||||||
|
|
Loading…
Reference in New Issue