aboutsummaryrefslogtreecommitdiff
path: root/hotline/transaction_handlers.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2022-06-25 21:46:08 -0700
committerGitHub <noreply@github.com>2022-06-25 21:46:08 -0700
commit1632959187e9c7d8946126914af99270fc14d40a (patch)
tree2c5e3316c800ad49248bf4d6b31bcb86f0993913 /hotline/transaction_handlers.go
parent889a8f76762b2cb924e74a6b18f1283afcceaa93 (diff)
parent1f34616efc9fa4b028892d4edb04af9da5b50a1a (diff)
Merge pull request #47 from jhalter/implement_access_send_priv_msg
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)