dkforest

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

commit 56ec2a86516f4f9c2a34e3f26701ec21950179e4
parent 01747a861e7e67f1e83d156008782ac9b503df5f
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Sat, 10 Jun 2023 03:40:25 -0700

improve code

Diffstat:
Mpkg/web/handlers/interceptors/slashInterceptor.go | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg/web/handlers/interceptors/slashInterceptor.go b/pkg/web/handlers/interceptors/slashInterceptor.go @@ -1311,8 +1311,8 @@ func handleDeleteMsgCmd(c *command.Command) (handled bool) { if err != nil { return err } - if msg.TooOldToDelete() { - return errors.New("message is too old to be deleted") + if err := msg.UserCanDeleteErr(*c.AuthUser); err != nil { + return err } if msg.RoomID == config.GeneralRoomID && msg.ToUserID == nil { msg.User.GeneralMessagesCount--