From 470f1b5455bcafeec74685b624b356151fec164e Mon Sep 17 00:00:00 2001 From: Aine Date: Wed, 2 Oct 2024 23:34:07 +0300 Subject: [PATCH] adjust 'redact all user events on remove' to the new API --- src/synapse/dataProvider.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/synapse/dataProvider.ts b/src/synapse/dataProvider.ts index 8be88f9..235ca58 100644 --- a/src/synapse/dataProvider.ts +++ b/src/synapse/dataProvider.ts @@ -825,8 +825,8 @@ const dataProvider = withLifecycleCallbacks(baseDataProvider, [ if (params.meta?.redactEvents) { const base_url = storage.getItem("base_url"); - const endpoint_url = `${base_url}/_synapse/admin/v1/users/${encodeURIComponent(returnMXID(params.id))}/redact`; - await jsonClient(endpoint_url, { method: "POST" }); + const endpoint_url = `${base_url}/_synapse/admin/v1/user/${encodeURIComponent(returnMXID(params.id))}/redact`; + await jsonClient(endpoint_url, { method: "POST", body: JSON.stringify({ rooms: [] }) }); } return params; @@ -842,8 +842,8 @@ const dataProvider = withLifecycleCallbacks(baseDataProvider, [ if (params.meta?.redactEvents) { const base_url = storage.getItem("base_url"); - const endpoint_url = `${base_url}/_synapse/admin/v1/users/${encodeURIComponent(returnMXID(id))}/redact`; - await jsonClient(endpoint_url, { method: "POST" }); + const endpoint_url = `${base_url}/_synapse/admin/v1/user/${encodeURIComponent(returnMXID(id))}/redact`; + await jsonClient(endpoint_url, { method: "POST", body: JSON.stringify({ rooms: [] }) }); } }) );