dkforest

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

commit 3e1beab9f32f8bcf6269bca216106341e9cd6f71
parent af00067363d2162f63fc6d75cc8ebbac90b98099
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Fri, 29 Dec 2023 22:23:18 -0500

cleanup useless warnings

Diffstat:
Mpkg/utils/utils.go | 3+++
Mpkg/web/handlers/api/v1/handlers.go | 6+++---
Mpkg/web/handlers/interceptors/slashInterceptor.go | 4++--
3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go @@ -1202,3 +1202,6 @@ func (_ CryptoRandSource) Int63() int64 { } func (_ CryptoRandSource) Seed(_ int64) {} + +func False() bool { return false } +func True() bool { return true } diff --git a/pkg/web/handlers/api/v1/handlers.go b/pkg/web/handlers/api/v1/handlers.go @@ -76,7 +76,7 @@ func chatMessages(c echo.Context) (status int, data ChatMessagesData) { managers.ActiveUsers.UpdateUserInRoom(room, managers.NewUserInfo(authUser)) displayHellbanned := authUser.DisplayHellbanned || authUser.IsHellbanned - displayIgnoredMessages := false + displayIgnoredMessages := utils.False() msgs, err := db.GetChatMessages(room.ID, roomKey, authUser.Username, authUser.ID, pmUserID, pmOnlyQuery, mentionsOnlyQuery, displayHellbanned, authUser.DisplayIgnored, authUser.DisplayModerators, displayIgnoredMessages, 150, 0) if err != nil { @@ -179,8 +179,8 @@ func RoomNotifierHandler(c echo.Context) error { managers.ActiveUsers.UpdateUserInRoom(room, managers.NewUserInfo(authUser)) displayHellbanned := authUser.DisplayHellbanned || authUser.IsHellbanned - mentionsOnly := false - displayIgnoredMessages := false + mentionsOnly := utils.False() + displayIgnoredMessages := utils.False() var pmUserID *database.UserID msgs, err := db.GetChatMessages(room.ID, roomKey, authUser.Username, authUser.ID, pmUserID, database.PmNoFilter, mentionsOnly, displayHellbanned, authUser.DisplayIgnored, authUser.DisplayModerators, displayIgnoredMessages, 150, 0) diff --git a/pkg/web/handlers/interceptors/slashInterceptor.go b/pkg/web/handlers/interceptors/slashInterceptor.go @@ -967,7 +967,7 @@ func handleEditCmd(c *command.Command) (handled bool) { } func canUserInboxOther(db *database.DkfDB, user, other database.User) error { - doesNotMatter := false + doesNotMatter := utils.False() _, err := dutils.CanUserPmOther(db, user, other, doesNotMatter) return err } @@ -1386,7 +1386,7 @@ func handleChipsBalanceCmd(c *command.Command) (handled bool) { } func handleTutorialCmd(c *command.Command) (handled bool) { - if c.Message == "/tuto" && false { + if c.Message == "/tuto" && utils.False() { name := "tuto_" + utils.GenerateToken10() room, _ := c.DB.CreateRoom(name, "", c.AuthUser.ID, false) c.Err = command.ErrRedirect