dkforest

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

commit eea6f8f74cf0bed1ab9d9b9fd75c74419f284cc6
parent b481297bb052bbff48b695023f1b206542696bd6
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Fri,  9 Jun 2023 09:52:08 -0700

display error if message too old to be edited

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

diff --git a/pkg/web/handlers/interceptors/slashInterceptor.go b/pkg/web/handlers/interceptors/slashInterceptor.go @@ -853,8 +853,14 @@ func handleEditCmd(c *command.Command) (handled bool) { } else if strings.HasPrefix(c.Message, "/system ") || strings.HasPrefix(c.Message, "/sys ") { handleSystemCmd(c) } + } else { + c.Err = fmt.Errorf("failed to get message at timestamp %s", date) } + } else { + c.Err = errors.New("message to old to be edited") } + } else { + c.Err = errors.New("failed to parse timestamp") } return true }