Commit 72cbb5ff authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Simplify some usages of client.error.

parent e05f2fee
...@@ -1376,8 +1376,7 @@ func handleClientMessage(c *client, m clientMessage) error { ...@@ -1376,8 +1376,7 @@ func handleClientMessage(c *client, m clientMessage) error {
} }
case "op", "unop", "present", "unpresent": case "op", "unop", "present", "unpresent":
if !c.permissions.Op { if !c.permissions.Op {
c.error(userError("not authorised")) return c.error(userError("not authorised"))
return nil
} }
err := setPermission(c.group, m.Id, m.Type) err := setPermission(c.group, m.Id, m.Type)
if err != nil { if err != nil {
...@@ -1385,8 +1384,7 @@ func handleClientMessage(c *client, m clientMessage) error { ...@@ -1385,8 +1384,7 @@ func handleClientMessage(c *client, m clientMessage) error {
} }
case "lock", "unlock": case "lock", "unlock":
if !c.permissions.Op { if !c.permissions.Op {
c.error(userError("not authorised")) return c.error(userError("not authorised"))
return nil
} }
var locked uint32 var locked uint32
if m.Type == "lock" { if m.Type == "lock" {
...@@ -1395,8 +1393,7 @@ func handleClientMessage(c *client, m clientMessage) error { ...@@ -1395,8 +1393,7 @@ func handleClientMessage(c *client, m clientMessage) error {
atomic.StoreUint32(&c.group.locked, locked) atomic.StoreUint32(&c.group.locked, locked)
case "kick": case "kick":
if !c.permissions.Op { if !c.permissions.Op {
c.error(userError("not authorised")) return c.error(userError("not authorised"))
return nil
} }
err := kickClient(c.group, m.Id) err := kickClient(c.group, m.Id)
if err != nil { if err != nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment