dkforest

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

commit e79dd16de24a752f23afbd693ff533e97401aba5
parent 8eb9b43f1d93c9e59cce7f41bdcd80603fb8180a
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Tue, 15 Nov 2022 14:12:56 -0500

allow inboxes if whitelisted; improve err message

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

diff --git a/pkg/web/handlers/api/v1/slashInterceptor.go b/pkg/web/handlers/api/v1/slashInterceptor.go @@ -1015,10 +1015,6 @@ func handleChessCmd(c *Command) (handled bool) { func handleInboxCmd(c *Command) (handled bool) { if m := inboxRgx.FindStringSubmatch(c.message); len(m) == 4 { - if !c.authUser.CanSendPM() { - c.err = errors.New("not enough karma") - return true - } username := m[1] encryptRaw := m[2] message := m[3] @@ -1035,6 +1031,10 @@ func handleInboxCmd(c *Command) (handled bool) { c.err = errors.New("you cannot inbox this user") return true } else if toUser.PmMode == database.PmModeStandard { + if !c.authUser.CanSendPM() { + c.err = errors.New("you need 20 public messages to unlock inboxes; or be whitelisted") + return true + } if database.IsUserPmBlacklisted(c.authUser.ID, toUser.ID) { c.err = errors.New("you cannot inbox this user") return true