PreKeyRepository

Functions

Link copied to clipboard
abstract suspend fun establishSessions(missingContactClients: Map<<Error class: unknown class>, List<<Error class: unknown class>>>): Either<CoreFailure, UsersWithoutSessions>
Link copied to clipboard
abstract suspend fun fetchRemotelyAvailablePrekeys(): Either<CoreFailure, List<Int>>

Fetches the IDs of the prekeys currently available on the backend.

Link copied to clipboard
abstract suspend fun forceInsertMostRecentPreKeyId(newId: Int): Either<StorageFailure, Unit>

Forces the insert of the ID of the most recent "rolling" prekey that was generated. Useful

Link copied to clipboard
abstract suspend fun generateNewLastResortKey(): Either<ProteusFailure, <Error class: unknown class>>

Also known as "last prekey", it's the prekey that the backend will share with other clients when it runs out of prekeys for this client. For "rolling" prekeys, see generateNewPreKeys.

Link copied to clipboard
abstract suspend fun generateNewPreKeys(firstKeyId: Int, keysCount: Int): Either<CoreFailure, List<<Error class: unknown class>>>

Generate prekeys to be uploaded to the backend and shared with other clients in order to initialise a new conversation with this client.

Link copied to clipboard
abstract suspend fun getFingerprintForPreKey(preKeyCrypto: <Error class: unknown class>): Either<CoreFailure, ByteArray>
Link copied to clipboard
abstract suspend fun getLocalFingerprint(): Either<CoreFailure, ByteArray>
Link copied to clipboard
abstract suspend fun lastPreKeyRefillCheckInstantFlow(): <Error class: unknown class><<Error class: unknown class>?>

Observes the last pre-key check instant.

Link copied to clipboard
abstract suspend fun mostRecentPreKeyId(): Either<StorageFailure, Int>

Returns the ID of the most recent "rolling" prekey that was generated.

Link copied to clipboard
abstract suspend fun setLastPreKeyRefillCheckInstant(instant: <Error class: unknown class>): Either<StorageFailure, Unit>

Sets the last prekey refill check date.

Link copied to clipboard
abstract suspend fun updateMostRecentPreKeyId(newId: Int): Either<StorageFailure, Unit>

Updates the ID of the most recent "rolling" prekey that was generated.

Link copied to clipboard
abstract suspend fun uploadNewPrekeyBatch(batch: List<<Error class: unknown class>>): Either<CoreFailure, Unit>

Uploads a batch of prekeys to the backend, so they become available for other clients to start sessions with this client.