adjust 'redact all user events on remove' to the new API

This commit is contained in:
Aine 2024-10-02 23:34:07 +03:00
parent 46cc0e2fda
commit 470f1b5455
No known key found for this signature in database
GPG key ID: 34969C908CCA2804

View file

@ -825,8 +825,8 @@ const dataProvider = withLifecycleCallbacks(baseDataProvider, [
if (params.meta?.redactEvents) { if (params.meta?.redactEvents) {
const base_url = storage.getItem("base_url"); const base_url = storage.getItem("base_url");
const endpoint_url = `${base_url}/_synapse/admin/v1/users/${encodeURIComponent(returnMXID(params.id))}/redact`; const endpoint_url = `${base_url}/_synapse/admin/v1/user/${encodeURIComponent(returnMXID(params.id))}/redact`;
await jsonClient(endpoint_url, { method: "POST" }); await jsonClient(endpoint_url, { method: "POST", body: JSON.stringify({ rooms: [] }) });
} }
return params; return params;
@ -842,8 +842,8 @@ const dataProvider = withLifecycleCallbacks(baseDataProvider, [
if (params.meta?.redactEvents) { if (params.meta?.redactEvents) {
const base_url = storage.getItem("base_url"); const base_url = storage.getItem("base_url");
const endpoint_url = `${base_url}/_synapse/admin/v1/users/${encodeURIComponent(returnMXID(id))}/redact`; const endpoint_url = `${base_url}/_synapse/admin/v1/user/${encodeURIComponent(returnMXID(id))}/redact`;
await jsonClient(endpoint_url, { method: "POST" }); await jsonClient(endpoint_url, { method: "POST", body: JSON.stringify({ rooms: [] }) });
} }
}) })
); );