Commit ca6c371e authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Send chat history after joined message.

This was broken when we eliminated the login message.
parent 120bfc92
...@@ -1044,12 +1044,30 @@ func handleClientMessage(c *webClient, m clientMessage) error { ...@@ -1044,12 +1044,30 @@ func handleClientMessage(c *webClient, m clientMessage) error {
} }
c.group = g c.group = g
perms := c.permissions perms := c.permissions
return c.write(clientMessage{ err = c.write(clientMessage{
Type: "joined", Type: "joined",
Kind: "join", Kind: "join",
Group: m.Group, Group: m.Group,
Permissions: &perms, Permissions: &perms,
}) })
if err != nil {
return err
}
h := c.group.GetChatHistory()
for _, m := range h {
message := m.Value
err := c.write(clientMessage{
Type: "chat",
Id: m.Id,
Username: m.User,
Time: m.Time,
Value: &message,
Kind: m.Kind,
})
if err != nil {
return err
}
}
case "request": case "request":
return c.setRequested(m.Request) return c.setRequested(m.Request)
case "offer": case "offer":
......
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