dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 21099dcf004d4c6b9a6bfac1ab9fe1b25641fd76
parent 846becdd6c9a360a44dbfda7e7312666aeb31e48
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Sun, 19 Mar 2023 15:46:41 -0700

kick spammers

Diffstat:
Mpkg/web/handlers/api/v1/spamInterceptor.go | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/pkg/web/handlers/api/v1/spamInterceptor.go b/pkg/web/handlers/api/v1/spamInterceptor.go @@ -108,6 +108,14 @@ func checkSpam(db *database.DkfDB, origMessage string, authUser *database.User) } if authUser.GeneralMessagesCount < 10 { + if strings.Contains(lowerCaseMessage, "blacktorcc") || + strings.Contains(lowerCaseMessage, "profjerry") { + _ = dutils.SelfKick(db, *authUser, silentSelfKick) + return ErrSpamFilterTriggered + } + } + + if authUser.GeneralMessagesCount < 10 { if wordsMap["porn"] > 0 && (wordsMap["link"] > 0 || wordsMap["links"] > 0) { _ = dutils.SelfKick(db, *authUser, silentSelfKick) return ErrSpamFilterTriggered