autovalidateMasterOwnKey method

Future<void> autovalidateMasterOwnKey()

Implementation

Future<void> autovalidateMasterOwnKey() async {
  // check if we can set our own master key as verified, if it isn't yet
  final userId = client.userID;
  final masterKey = client.userDeviceKeys[userId]?.masterKey;
  if (client.database != null &&
      masterKey != null &&
      userId != null &&
      !masterKey.directVerified &&
      masterKey.hasValidSignatureChain(onlyValidateUserIds: {userId})) {
    await masterKey.setVerified(true);
  }
}