decryptSpaceFeeds function
Future<List<SpaceFeeds> >
decryptSpaceFeeds({
- required List<
SpaceFeeds> feeds, - required User connectedUser,
- required String pgpPrivateKey,
Implementation
Future<List<SpaceFeeds>> decryptSpaceFeeds({
required List<SpaceFeeds> feeds,
required User connectedUser,
required String pgpPrivateKey,
}) async {
final updatedFeeds = <SpaceFeeds>[];
for (var feed in feeds) {
final msg = feed.msg!;
if (msg.encType != 'PlainText') {
feed.msg = await decryptAndVerifyMessage(
pgpPublicKey: connectedUser.publicKey!,
message: msg,
pgpPrivateKey: pgpPrivateKey,
);
updatedFeeds.add(feed);
} else {
updatedFeeds.add(feed);
}
}
return updatedFeeds;
}