enableEncryption method

Future<void> enableEncryption({
  1. int algorithmIndex = 0,
})

Implementation

Future<void> enableEncryption({int algorithmIndex = 0}) async {
  if (encrypted) throw ('Encryption is already enabled!');
  final algorithm = Client.supportedGroupEncryptionAlgorithms[algorithmIndex];
  await client.setRoomStateWithKey(
    id,
    EventTypes.Encryption,
    '',
    {
      'algorithm': algorithm,
    },
  );
  return;
}