Add timestamp to messages. For #26

This commit is contained in:
Gabe Kangas
2020-07-11 19:08:47 -07:00
parent b7231847e1
commit d7a2ffcca4
3 changed files with 15 additions and 11 deletions

View File

@@ -110,6 +110,7 @@ func (c *Client) listenRead() {
msg.ID = id
msg.MessageType = "CHAT"
msg.Timestamp = time.Now()
if err := websocket.JSON.Receive(c.ws, &msg); err == io.EOF {
c.doneCh <- true