dkforest

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

commit 854a2d1c036676580daef25f869a672ad14ed483
parent 796a152f753611710922c4147cc86707ec024906
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Thu, 19 Jan 2023 22:07:39 -0800

test

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

diff --git a/pkg/web/handlers/api/v1/spamInterceptor.go b/pkg/web/handlers/api/v1/spamInterceptor.go @@ -101,6 +101,13 @@ func checkSpam(origMessage string, authUser *database.User) error { } } + if authUser.GeneralMessagesCount < 10 { + if wordsMap["porn"] > 0 && (wordsMap["link"] > 0 || wordsMap["links"] > 0) { + _ = dutils.SelfKick(*authUser, silentSelfKick) + return ErrSpamFilterTriggered + } + } + if authUser.GeneralMessagesCount < 20 || time.Since(authUser.CreatedAt) < 5*time.Hour { if wordsMap["cp"] > 0 && (wordsMap["link"] > 0 || wordsMap["links"] > 0) { _ = dutils.SelfKick(*authUser, silentSelfKick)