maybeAutoRequest method

void maybeAutoRequest(
  1. String roomId,
  2. String sessionId,
  3. String? senderKey, {
  4. bool tryOnlineBackup = true,
  5. bool onlineKeyBackupOnly = true,
})

Attempt auto-request for a key

Implementation

void maybeAutoRequest(
  String roomId,
  String sessionId,
  String? senderKey, {
  bool tryOnlineBackup = true,
  bool onlineKeyBackupOnly = true,
}) {
  final room = client.getRoomById(roomId);
  final requestIdent = '$roomId|$sessionId';
  if (room != null &&
      !_requestedSessionIds.contains(requestIdent) &&
      !client.isUnknownSession) {
    // do e2ee recovery
    _requestedSessionIds.add(requestIdent);

    runInRoot(() async => request(
          room,
          sessionId,
          senderKey,
          tryOnlineBackup: tryOnlineBackup,
          onlineKeyBackupOnly: onlineKeyBackupOnly,
        ));
  }
}