loadSingleKey method

Future<void> loadSingleKey(
  1. String roomId,
  2. String sessionId
)

Loads a single key for the specified room from the online key backup and stores it.

Implementation

Future<void> loadSingleKey(String roomId, String sessionId) async {
  final info = await getRoomKeysBackupInfo();
  final ret =
      await client.getRoomKeyBySessionId(roomId, sessionId, info.version);
  final keys = RoomKeys.fromJson({
    'rooms': {
      roomId: {
        'sessions': {
          sessionId: ret.toJson(),
        },
      },
    },
  });
  await loadFromResponse(keys);
}