mirror of
https://github.com/jech/galene.git
synced 2024-11-10 02:35:58 +01:00
Don't send permissions with each client message.
Thanks to Antonin Décimo.
This commit is contained in:
parent
08a2ff63fc
commit
1ed2540bd7
1 changed files with 5 additions and 3 deletions
|
@ -144,7 +144,7 @@ type clientMessage struct {
|
||||||
Dest string `json:"dest,omitempty"`
|
Dest string `json:"dest,omitempty"`
|
||||||
Username string `json:"username,omitempty"`
|
Username string `json:"username,omitempty"`
|
||||||
Password string `json:"password,omitempty"`
|
Password string `json:"password,omitempty"`
|
||||||
Permissions group.ClientPermissions `json:"permissions,omitempty"`
|
Permissions *group.ClientPermissions `json:"permissions,omitempty"`
|
||||||
Group string `json:"group,omitempty"`
|
Group string `json:"group,omitempty"`
|
||||||
Value string `json:"value,omitempty"`
|
Value string `json:"value,omitempty"`
|
||||||
Time int64 `json:"time,omitempty"`
|
Time int64 `json:"time,omitempty"`
|
||||||
|
@ -743,9 +743,10 @@ func clientLoop(c *webClient, ws *websocket.Conn) error {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
perms := c.permissions
|
||||||
c.write(clientMessage{
|
c.write(clientMessage{
|
||||||
Type: "permissions",
|
Type: "permissions",
|
||||||
Permissions: c.permissions,
|
Permissions: &perms,
|
||||||
})
|
})
|
||||||
|
|
||||||
h := c.group.GetChatHistory()
|
h := c.group.GetChatHistory()
|
||||||
|
@ -866,9 +867,10 @@ func clientLoop(c *webClient, ws *websocket.Conn) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
case permissionsChangedAction:
|
case permissionsChangedAction:
|
||||||
|
perms := c.permissions
|
||||||
c.write(clientMessage{
|
c.write(clientMessage{
|
||||||
Type: "permissions",
|
Type: "permissions",
|
||||||
Permissions: c.permissions,
|
Permissions: &perms,
|
||||||
})
|
})
|
||||||
if !c.permissions.Present {
|
if !c.permissions.Present {
|
||||||
up := getUpConns(c)
|
up := getUpConns(c)
|
||||||
|
|
Loading…
Reference in a new issue