Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use admin api for redactions if possible #538

Merged
merged 8 commits into from
Oct 10, 2024
Merged

Use admin api for redactions if possible #538

merged 8 commits into from
Oct 10, 2024

Conversation

H-Shay
Copy link
Contributor

@H-Shay H-Shay commented Oct 5, 2024

No description provided.

@H-Shay H-Shay marked this pull request as draft October 5, 2024 02:24
@H-Shay H-Shay marked this pull request as ready for review October 5, 2024 03:17
@H-Shay H-Shay requested a review from turt2live October 7, 2024 20:48
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall lgtm - just a couple of comments on the function placement

Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

src/utils.ts Outdated
Comment on lines 84 to 88
let redactID: string;
const body = { limit: limit, rooms: targetRooms };
const redactEndpoint = `/_synapse/admin/v1/user/${userId}/redact`;
const response = await client.doRequest("GET", redactEndpoint, null, body);
redactID = response["redact_id"];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let redactID: string;
const body = { limit: limit, rooms: targetRooms };
const redactEndpoint = `/_synapse/admin/v1/user/${userId}/redact`;
const response = await client.doRequest("GET", redactEndpoint, null, body);
redactID = response["redact_id"];
const body = { limit: limit, rooms: targetRooms };
const redactEndpoint = `/_synapse/admin/v1/user/${userId}/redact`;
const response = await client.doRequest("GET", redactEndpoint, null, body);
const redactID = response["redact_id"];

if it's complaining about types, use response["redact_id"] as string

@H-Shay H-Shay merged commit aa7e8d4 into main Oct 10, 2024
5 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants