You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-29 22:48:10 +02:00
All: Fixes #6645: Do not encrypt non-owned note if it was not shared encrypted
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
import { BaseItemEntity } from '../../services/database/types';
|
||||
import { StateShare } from '../../services/share/reducer';
|
||||
|
||||
export default function(resource: BaseItemEntity): boolean {
|
||||
return !resource.is_shared;
|
||||
export default function(item: BaseItemEntity, share: StateShare): boolean {
|
||||
// Note has been published - currently we don't encrypt
|
||||
if (item.is_shared) return false;
|
||||
|
||||
// Item has been shared with user, but sharee is not encrypting his notes,
|
||||
// so we shouldn't encrypt it either. Otherwise sharee will not be able to
|
||||
// view the note anymore. https://github.com/laurent22/joplin/issues/6645
|
||||
if (item.share_id && (!share || !share.master_key_id)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user