mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 00:37:47 +00:00
minor refactoring
This commit is contained in:
parent
f6455253a0
commit
6dfa882803
@ -275,11 +275,8 @@ fun MessageSender.sendLatestEncryptionKeyPair(publicKey: String, groupPublicKey:
|
||||
return
|
||||
}
|
||||
// Get the latest encryption key pair
|
||||
val encryptionKeyPair = if (pendingKeyPair[groupPublicKey] != null && pendingKeyPair[groupPublicKey]!!.isPresent) {
|
||||
pendingKeyPair[groupPublicKey]!!.get()
|
||||
} else {
|
||||
storage.getLatestClosedGroupEncryptionKeyPair(groupPublicKey)
|
||||
} ?: return
|
||||
val encryptionKeyPair = pendingKeyPair[groupPublicKey]?.orNull()
|
||||
?: storage.getLatestClosedGroupEncryptionKeyPair(groupPublicKey) ?: return
|
||||
// Send it
|
||||
val proto = SignalServiceProtos.KeyPair.newBuilder()
|
||||
proto.publicKey = ByteString.copyFrom(encryptionKeyPair.publicKey.serialize())
|
||||
|
Loading…
x
Reference in New Issue
Block a user