Skip to content

Commit

Permalink
Add some doc
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarty committed Jan 4, 2023
1 parent 06f3c11 commit 437b93c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()

/**
Expand Down Expand Up @@ -291,13 +303,17 @@ 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

/**
* 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
Expand Down Expand Up @@ -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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)

0 comments on commit 437b93c

Please sign in to comment.