Skip to content

Commit 437b93c

Browse files
committed
Add some doc
1 parent 06f3c11 commit 437b93c

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/IMXCryptoStore.kt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,19 @@ import org.matrix.olm.OlmOutboundGroupSession
4848
*/
4949
internal interface IMXCryptoStore {
5050

51+
/**
52+
* Notify the store that a sync response treatment is starting.
53+
* Impacted methods:
54+
* - [setShouldShareHistory]
55+
* - [setShouldEncryptForInvitedMembers]
56+
* @See [onSyncCompleted] to notify that the treatment is over.
57+
*/
5158
fun onSyncWillProcess()
59+
60+
/**
61+
* Notify the store that the sync treatment response is finished.
62+
* The store will save all aggregated data.
63+
*/
5264
fun onSyncCompleted()
5365

5466
/**
@@ -291,13 +303,17 @@ internal interface IMXCryptoStore {
291303

292304
fun shouldEncryptForInvitedMembers(roomId: String): Boolean
293305

306+
/**
307+
* The data is not stored immediately, this MUST be call during a sync response treatment.
308+
*/
294309
fun setShouldEncryptForInvitedMembers(roomId: String, shouldEncryptForInvitedMembers: Boolean)
295310

296311
fun shouldShareHistory(roomId: String): Boolean
297312

298313
/**
299314
* Sets a boolean flag that will determine whether or not room history (existing inbound sessions)
300315
* will be shared to new user invites.
316+
* The data is not stored immediately, this MUST be call during a sync response treatment.
301317
*
302318
* @param roomId the room id
303319
* @param shouldShareHistory The boolean flag
@@ -582,5 +598,8 @@ internal interface IMXCryptoStore {
582598
fun tidyUpDataBase()
583599
fun getOutgoingRoomKeyRequests(inStates: Set<OutgoingRoomKeyRequestState>): List<OutgoingKeyRequest>
584600

601+
/**
602+
* Store a bunch of data related to the users. @See [UserDataToStore].
603+
*/
585604
fun storeUserDataToStore(userDataToStore: UserDataToStore)
586605
}

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/UserDataToStore.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ import org.matrix.android.sdk.api.session.crypto.crosssigning.CryptoCrossSigning
2020
import org.matrix.android.sdk.api.session.crypto.model.CryptoDeviceInfo
2121

2222
internal data class UserDataToStore(
23+
/**
24+
* Map of userId -> (Map of deviceId -> [CryptoDeviceInfo]).
25+
*/
2326
val userDevices: MutableMap<String, Map<String, CryptoDeviceInfo>> = mutableMapOf(),
27+
/**
28+
* Map of userId -> [CryptoCrossSigningKeys].
29+
*/
2430
val userCrossSigningKeys: MutableMap<String, CryptoCrossSigningKeys> = mutableMapOf(),
2531
)

0 commit comments

Comments
 (0)