dkforest

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

commit 0639bd32e2728ddf1d54459728e1708069fbcb02
parent 78544966ad6a31dd1e48bf913f51501b63ebea0d
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Sat, 17 Dec 2022 23:50:11 -0800

improve errors

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

diff --git a/pkg/web/handlers/api/v1/slashInterceptor.go b/pkg/web/handlers/api/v1/slashInterceptor.go @@ -366,7 +366,13 @@ func handleHbmtCmd(c *Command) (handled bool) { if msg, err := database.GetRoomChatMessageByDate(c.room.ID, c.authUser.ID, dt.UTC()); err == nil { msg.IsHellbanned = !msg.IsHellbanned msg.DoSave() + } else { + c.err = errors.New("no message found at this timestamp") + return true } + } else { + c.err = errors.New("message is too old to be edited") + return true } } c.err = ErrRedirect