1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-09 18:25:58 +01:00

Send chat history after joined message.

This was broken when we eliminated the login message.
This commit is contained in:
Juliusz Chroboczek 2020-12-04 11:31:20 +01:00
parent 120bfc92c7
commit ca6c371ec4

View file

@ -1044,12 +1044,30 @@ func handleClientMessage(c *webClient, m clientMessage) error {
}
c.group = g
perms := c.permissions
return c.write(clientMessage{
err = c.write(clientMessage{
Type: "joined",
Kind: "join",
Group: m.Group,
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":
return c.setRequested(m.Request)
case "offer":