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

Check if post was hidden #53

Merged
merged 5 commits into from
Nov 29, 2023
Merged

Check if post was hidden #53

merged 5 commits into from
Nov 29, 2023

Conversation

MixailE
Copy link
Contributor

@MixailE MixailE commented Nov 19, 2023

No description provided.

@MixailE
Copy link
Contributor Author

MixailE commented Nov 19, 2023

const numberCommentId = commentId.toNumber()
if (
(await isBanned(numberFeedId, numberPostId)) ||
(await isBanned(numberFeedId, numberPostId, numberCommentId))
Copy link

Choose a reason for hiding this comment

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

I don't think the second condition will be true because it won't and cannot be banned when the listener catches a new comment.
I assume we need to check only the post, if it is banned or not.

Copy link

Choose a reason for hiding this comment

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

If you want to check the parent comment (replyTo), you have a fourth prop (eventComment) which contains replyTo. If it's equal to 0, this is a comment to the post; otherwise, it's a comment to comment.

Copy link

Choose a reason for hiding this comment

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

Let's remove this check for now - await isBanned(numberFeedId, numberPostId, numberCommentId)
Don't forget to create a task to check parent comment if it's block, before notify about it

Copy link

@smyzin smyzin left a comment

Choose a reason for hiding this comment

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

We need to block pushes if post or parent comment is blocked

const numberCommentId = commentId.toNumber()
if (
(await isBanned(numberFeedId, numberPostId)) ||
(await isBanned(numberFeedId, numberPostId, numberCommentId))
Copy link

Choose a reason for hiding this comment

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

Let's remove this check for now - await isBanned(numberFeedId, numberPostId, numberCommentId)
Don't forget to create a task to check parent comment if it's block, before notify about it

Copy link
Contributor

@T-Damer T-Damer left a comment

Choose a reason for hiding this comment

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

Looks good, let's merge it in the morning :)

@MixailE MixailE merged commit 65d60a1 into main Nov 29, 2023
@MixailE MixailE deleted the check-if-post-was-hidden branch November 29, 2023 11:57
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.

3 participants