dkforest

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

commit df8527df8bbce87d0cc42c070fe49f08ca092bf6
parent b4e55a944840c66adc444fb2c68e48a070b3d3a2
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Mon, 29 May 2023 20:30:04 -0700

command to update read-marker

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

diff --git a/pkg/web/handlers/api/v1/slashInterceptor.go b/pkg/web/handlers/api/v1/slashInterceptor.go @@ -90,6 +90,7 @@ func handleUserCmd(c *Command) (handled bool) { handleSuccessCmd(c) || handleAfkCmd(c) || handleDateCmd(c) || + handleUpdateReadMarkerCmd(c) || handleErrorCmd(c) } @@ -1726,3 +1727,12 @@ func handleRefreshCmd(c *Command) (handled bool) { } return } + +func handleUpdateReadMarkerCmd(c *Command) (handled bool) { + if c.message == "/r" { + c.db.UpdateChatReadMarker(c.authUser.ID, c.room.ID) + c.err = ErrRedirect + return true + } + return +}