PreKeyDataSource

class PreKeyDataSource(preKeyApi: <Error class: unknown class>, proteusClientProvider: ProteusClientProvider, provideCurrentClientId: CurrentClientIdProvider, prekeyDAO: <Error class: unknown class>, clientDAO: <Error class: unknown class>, metadataDAO: <Error class: unknown class>, preKeyListMapper: PreKeyListMapper = MapperProvider.preKeyListMapper(), preKeyMapper: PreKeyMapper = MapperProvider.preyKeyMapper()) : PreKeyRepository, CryptoSessionMapper

Constructors

Link copied to clipboard
constructor(preKeyApi: <Error class: unknown class>, proteusClientProvider: ProteusClientProvider, provideCurrentClientId: CurrentClientIdProvider, prekeyDAO: <Error class: unknown class>, clientDAO: <Error class: unknown class>, metadataDAO: <Error class: unknown class>, preKeyListMapper: PreKeyListMapper = MapperProvider.preKeyListMapper(), preKeyMapper: PreKeyMapper = MapperProvider.preyKeyMapper())

Functions

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

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

Link copied to clipboard
open suspend override 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
open suspend override 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
open suspend override fun generateNewPreKeys(firstKeyId: Int, keysCount: Int): Either<ProteusFailure, 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
open suspend override fun getFingerprintForPreKey(preKeyCrypto: <Error class: unknown class>): Either<CoreFailure, ByteArray>
Link copied to clipboard
open suspend override fun getLocalFingerprint(): Either<CoreFailure, ByteArray>
open override fun getMapOfSessionIdsToPreKeysAndMarkNullClientsAsInvalid(preKeyInfoMap: Map<String, Map<String, Map<String, <Error class: unknown class>?>>>): FilteredRecipient
Link copied to clipboard
open suspend override fun lastPreKeyRefillCheckInstantFlow(): <Error class: unknown class><<Error class: unknown class>?>

Observes the last pre-key check instant.

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

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

Link copied to clipboard
internal suspend fun preKeysOfClientsByQualifiedUsers(qualifiedIdsMap: Map<<Error class: unknown class>, List<<Error class: unknown class>>>): Either<NetworkFailure, <Error class: unknown class>>
Link copied to clipboard
open suspend override fun setLastPreKeyRefillCheckInstant(instant: <Error class: unknown class>): Either<StorageFailure, Unit>

Sets the last prekey refill check date.

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

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

Link copied to clipboard
open suspend override 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.