fix: don't send connected-account key as JMAP accountId when sharing files #408
This commit is contained in:
@@ -1015,11 +1015,14 @@ export const useFileStore = create<FileState>((set, get) => ({
|
|||||||
},
|
},
|
||||||
|
|
||||||
shareResource: async (id: string, principalId: string, rights: FileNodeRights | null) => {
|
shareResource: async (id: string, principalId: string, rights: FileNodeRights | null) => {
|
||||||
const { client, currentAccountId, refresh } = get();
|
const { client, refresh } = get();
|
||||||
if (!client) return;
|
if (!client) return;
|
||||||
// Owned nodes are browsed in the current account, so their ids are not
|
// currentAccountId is the webmail's connected-account key ("user@host"),
|
||||||
// namespaced; route the share to that account (defaults to the files account).
|
// not a JMAP account id - Stalwart parses accountId strictly while
|
||||||
await client.setFileNodeShare(id, principalId, rights, currentAccountId ?? undefined);
|
// deserializing the request, so sending it rejects the whole call with
|
||||||
|
// notRequest. The client is already the per-account client; let
|
||||||
|
// setFileNodeShare resolve its own files account.
|
||||||
|
await client.setFileNodeShare(id, principalId, rights);
|
||||||
await refresh();
|
await refresh();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user