aboutsummaryrefslogtreecommitdiff
path: root/hotline/transaction_handlers.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2022-06-25 21:44:14 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2022-06-25 21:44:14 -0700
commit69c2fb504953cf8de3730b2f64cfa8d7b6b13859 (patch)
treeb5c831e1f0e3cb09c20086cfa7ed8818cad61a4c /hotline/transaction_handlers.go
parent889a8f76762b2cb924e74a6b18f1283afcceaa93 (diff)
Implement "Can Send Messages" permission
Diffstat (limited to 'hotline/transaction_handlers.go')
-rw-r--r--hotline/transaction_handlers.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/hotline/transaction_handlers.go b/hotline/transaction_handlers.go
index 412868c..85879a4 100644
--- a/hotline/transaction_handlers.go
+++ b/hotline/transaction_handlers.go
@@ -299,6 +299,11 @@ func HandleChatSend(cc *ClientConn, t *Transaction) (res []Transaction, err erro
// Fields used in the reply:
// None
func HandleSendInstantMsg(cc *ClientConn, t *Transaction) (res []Transaction, err error) {
+ if !cc.Authorize(accessSendPrivMsg) {
+ res = append(res, cc.NewErrReply(t, "You are not allowed to send private messages."))
+ return res, err
+ }
+
msg := t.GetField(fieldData)
ID := t.GetField(fieldUserID)