Commit 1ed2540b authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Don't send permissions with each client message.

Thanks to Antonin Décimo.
parent 08a2ff63
......@@ -144,7 +144,7 @@ type clientMessage struct {
Dest string `json:"dest,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Permissions group.ClientPermissions `json:"permissions,omitempty"`
Permissions *group.ClientPermissions `json:"permissions,omitempty"`
Group string `json:"group,omitempty"`
Value string `json:"value,omitempty"`
Time int64 `json:"time,omitempty"`
......@@ -743,9 +743,10 @@ func clientLoop(c *webClient, ws *websocket.Conn) error {
}
}()
perms := c.permissions
c.write(clientMessage{
Type: "permissions",
Permissions: c.permissions,
Permissions: &perms,
})
h := c.group.GetChatHistory()
......@@ -866,9 +867,10 @@ func clientLoop(c *webClient, ws *websocket.Conn) error {
}
case permissionsChangedAction:
perms := c.permissions
c.write(clientMessage{
Type: "permissions",
Permissions: c.permissions,
Permissions: &perms,
})
if !c.permissions.Present {
up := getUpConns(c)
......
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