1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

All: Fixes #6645: Do not encrypt non-owned note if it was not shared encrypted

This commit is contained in:
Laurent Cozic
2022-07-12 11:28:48 +01:00
parent 0b3c4edb92
commit 06d5feaa63
4 changed files with 14 additions and 4 deletions

View File

@ -418,7 +418,7 @@ export default class BaseItem extends BaseModel {
const share = item.share_id ? await this.shareService().shareById(item.share_id) : null;
const serialized = await ItemClass.serialize(item, shownKeys);
if (!getEncryptionEnabled() || !ItemClass.encryptionSupported() || !itemCanBeEncrypted(item)) {
if (!getEncryptionEnabled() || !ItemClass.encryptionSupported() || !itemCanBeEncrypted(item, share)) {
// Normally not possible since itemsThatNeedSync should only return decrypted items
if (item.encryption_applied) throw new JoplinError('Item is encrypted but encryption is currently disabled', 'cannotSyncEncrypted');
return serialized;