go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.17k stars 5.49k forks source link

[Enhancement] Prevent creation of duplicated comments in a row #11185

Open 6543 opened 4 years ago

6543 commented 4 years ago

bevor creating a new comment check if the last one related to a issue/pull has the same contend and poster

just see: https://gitea.com/gitea/tea/pulls/125#issuecomment-111984

lunny commented 4 years ago

This should be a anti-spam policy.

6543 commented 4 years ago

A sma xorm query should do it ...
e.where("poster_id=? And issue_id=?",poster,issue).sort(byId, latestfirst).Get(comment)

If comment.content == newcomment.contend -> return error

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

a1012112796 commented 4 years ago

ping, I think maybe we should have a minimum time interval limit. If interval time is too short, we should skip this new comment.

6543 commented 4 years ago

Codeberg has a patch witch is doing this ...

https://codeberg.org/6543/Codeberg-gitea/pulls/2/commits

6543 commented 4 years ago

but I would make it more configurable:

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

6543 commented 4 years ago

Ping

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

a1012112796 commented 4 years ago

ping :)