diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/timeline/Timeline.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/timeline/Timeline.kt index eb4a9b59e4..d7d6682046 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/timeline/Timeline.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/timeline/Timeline.kt @@ -104,6 +104,7 @@ interface Timeline { interface Listener { /** * Call when the timeline has been updated through pagination or sync. + * The latest event is the first in the list * @param snapshot the most up to date snapshot */ fun onTimelineUpdated(snapshot: List) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/store/IMXCryptoStore.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/store/IMXCryptoStore.kt index a8f65e9219..c5a89b10e7 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/store/IMXCryptoStore.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/store/IMXCryptoStore.kt @@ -262,7 +262,7 @@ internal interface IMXCryptoStore { * @param deviceKey the public key of the other device. * @return The Base64 end-to-end session, or null if not found */ - fun getDeviceSession(sessionId: String?, deviceKey: String?): OlmSessionWrapper? + fun getDeviceSession(sessionId: String, deviceKey: String): OlmSessionWrapper? /** * Retrieve the last used sessionId, regarding `lastReceivedMessageTs`, or null if no session exist diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/store/db/RealmCryptoStore.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/store/db/RealmCryptoStore.kt index bd51cf8539..a6f3f5d593 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/store/db/RealmCryptoStore.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/store/db/RealmCryptoStore.kt @@ -555,11 +555,7 @@ internal class RealmCryptoStore @Inject constructor( } } - override fun getDeviceSession(sessionId: String?, deviceKey: String?): OlmSessionWrapper? { - if (sessionId == null || deviceKey == null) { - return null - } - + override fun getDeviceSession(sessionId: String, deviceKey: String): OlmSessionWrapper? { val key = OlmSessionEntity.createPrimaryKey(sessionId, deviceKey) // If not in cache (or not found), try to read it from realm