Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Improve messaging and checks in NSFW protection #529

Merged
merged 5 commits into from
Oct 1, 2024
Merged

Conversation

H-Shay
Copy link
Contributor

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

No description provided.

@H-Shay H-Shay requested a review from turt2live October 1, 2024 19:15
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 this lgtm - while reviewing it occurred to me we might be able to handle weird future cases as well with some JSON trickery.

src/protections/NsfwProtection.ts Outdated Show resolved Hide resolved
src/protections/NsfwProtection.ts Outdated Show resolved Hide resolved
src/protections/NsfwProtection.ts Outdated Show resolved Hide resolved
@H-Shay H-Shay requested a review from turt2live October 1, 2024 22:13
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.

otherwise lgtm, I think.

const msgtype = content['msgtype'] || 'm.text';
const isMedia = msgtype === 'm.image';
let content = JSON.stringify(event['content']);
content = content.replace(/"|{|}/g, '')
Copy link
Member

Choose a reason for hiding this comment

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

this could do with a comment for what it's fixing about the input (I'm not sure myself).

@H-Shay H-Shay requested a review from turt2live October 1, 2024 22:25
@H-Shay H-Shay merged commit 74d2c9b into main Oct 1, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants