Add some doc

This commit is contained in:
Benoit Marty 2023-01-04 11:35:04 +01:00
parent 06f3c11010
commit 437b93cc18
2 changed files with 25 additions and 0 deletions

View file

@ -48,7 +48,19 @@ import org.matrix.olm.OlmOutboundGroupSession
*/
internal interface IMXCryptoStore {
/**
* Notify the store that a sync response treatment is starting.
* Impacted methods:
* - [setShouldShareHistory]
* - [setShouldEncryptForInvitedMembers]
* @See [onSyncCompleted] to notify that the treatment is over.
*/
fun onSyncWillProcess()
/**
* Notify the store that the sync treatment response is finished.
* The store will save all aggregated data.
*/
fun onSyncCompleted()
/**
@ -291,6 +303,9 @@ internal interface IMXCryptoStore {
fun shouldEncryptForInvitedMembers(roomId: String): Boolean
/**
* The data is not stored immediately, this MUST be call during a sync response treatment.
*/
fun setShouldEncryptForInvitedMembers(roomId: String, shouldEncryptForInvitedMembers: Boolean)
fun shouldShareHistory(roomId: String): Boolean
@ -298,6 +313,7 @@ internal interface IMXCryptoStore {
/**
* Sets a boolean flag that will determine whether or not room history (existing inbound sessions)
* will be shared to new user invites.
* The data is not stored immediately, this MUST be call during a sync response treatment.
*
* @param roomId the room id
* @param shouldShareHistory The boolean flag
@ -582,5 +598,8 @@ internal interface IMXCryptoStore {
fun tidyUpDataBase()
fun getOutgoingRoomKeyRequests(inStates: Set<OutgoingRoomKeyRequestState>): List<OutgoingKeyRequest>
/**
* Store a bunch of data related to the users. @See [UserDataToStore].
*/
fun storeUserDataToStore(userDataToStore: UserDataToStore)
}

View file

@ -20,6 +20,12 @@ import org.matrix.android.sdk.api.session.crypto.crosssigning.CryptoCrossSigning
import org.matrix.android.sdk.api.session.crypto.model.CryptoDeviceInfo
internal data class UserDataToStore(
/**
* Map of userId -> (Map of deviceId -> [CryptoDeviceInfo]).
*/
val userDevices: MutableMap<String, Map<String, CryptoDeviceInfo>> = mutableMapOf(),
/**
* Map of userId -> [CryptoCrossSigningKeys].
*/
val userCrossSigningKeys: MutableMap<String, CryptoCrossSigningKeys> = mutableMapOf(),
)