decryptConversation function
Implementation
Future<List<Message>> decryptConversation({
required List<Message> messages,
required User? connectedUser,
required String pgpPrivateKey,
}) async {
final updatedMessages = <Message>[];
for (var msg in messages) {
if (msg.encType != 'PlainText') {
msg = await decryptAndVerifyMessage(
pgpPrivateKey: pgpPrivateKey,
pgpPublicKey: connectedUser!.publicKey!,
message: msg,
);
}
updatedMessages.add(msg);
}
return updatedMessages;
}