storeOlmSession method

  1. @override
Future<void> storeOlmSession(
  1. String identityKey,
  2. String sessionId,
  3. String pickle,
  4. int lastReceived,
)
override

Implementation

@override
Future<void> storeOlmSession(String identityKey, String sessionId,
    String pickle, int lastReceived) async {
  final rawSessions =
      (await _olmSessionsBox.get(identityKey.toHiveKey) as Map?) ?? {};
  rawSessions[sessionId] = <String, dynamic>{
    'identity_key': identityKey,
    'pickle': pickle,
    'session_id': sessionId,
    'last_received': lastReceived,
  };
  await _olmSessionsBox.put(identityKey.toHiveKey, rawSessions);
  return;
}