dkforest

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

commit 36846850d1ce216fbd5eb05555af6f942483843f
parent 5eb36f26ffcd467e5016d8b769c1f41a4bac02c4
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Thu,  2 Mar 2023 19:59:46 -0800

fix audits

Diffstat:
Mpkg/web/handlers/handlers.go | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go @@ -1913,6 +1913,7 @@ func ThreadReplyHandler(c echo.Context) error { return c.Render(http.StatusOK, "thread-reply", data) } if isForumSpam(data.Message) { + database.NewAudit(*authUser, fmt.Sprintf("spam forum thread reply %s (#%d)", authUser.Username, authUser.ID)) authUser.CanUseForum = false authUser.DoSave() return c.Redirect(http.StatusFound, "/") @@ -2178,6 +2179,7 @@ func ThreadEditMessageHandler(c echo.Context) error { return c.Render(http.StatusOK, "thread-reply", data) } if isForumSpam(data.Message) { + database.NewAudit(*authUser, fmt.Sprintf("spam forum edit msg %s (#%d)", authUser.Username, authUser.ID)) authUser.CanUseForum = false authUser.DoSave() return c.Redirect(http.StatusFound, "/") @@ -2267,7 +2269,7 @@ func NewThreadHandler(c echo.Context) error { return c.Render(http.StatusOK, "new-thread", data) } if isForumSpam(data.Message) { - database.NewAudit(*authUser, fmt.Sprintf("spam forum %s (#%d)", authUser.Username, authUser.ID)) + database.NewAudit(*authUser, fmt.Sprintf("spam forum new thread %s (#%d)", authUser.Username, authUser.ID)) authUser.CanUseForum = false authUser.DoSave() return c.Redirect(http.StatusFound, "/")