mirror of
https://github.com/jech/galene.git
synced 2024-11-22 16:45:58 +01:00
Send chat history after joined message.
This was broken when we eliminated the login message.
This commit is contained in:
parent
120bfc92c7
commit
ca6c371ec4
1 changed files with 19 additions and 1 deletions
|
@ -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":
|
||||||
|
|
Loading…
Reference in a new issue