3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-10 22:19:31 +01:00

Merge pull request #95 from martinlindhe/master

server-time: convert local time to UTC before using it
This commit is contained in:
Daniel Oaks 2017-02-08 07:06:02 +10:00 committed by GitHub
commit 0d8a445c7b

View File

@ -550,10 +550,11 @@ var (
func (client *Client) Send(tags *map[string]ircmsg.TagValue, prefix string, command string, params ...string) error { func (client *Client) Send(tags *map[string]ircmsg.TagValue, prefix string, command string, params ...string) error {
// attach server-time // attach server-time
if client.capabilities[ServerTime] { if client.capabilities[ServerTime] {
t := time.Now().UTC().Format("2006-01-02T15:04:05.999Z")
if tags == nil { if tags == nil {
tags = ircmsg.MakeTags("time", time.Now().Format("2006-01-02T15:04:05.999Z")) tags = ircmsg.MakeTags("time", t)
} else { } else {
(*tags)["time"] = ircmsg.MakeTagValue(time.Now().Format("2006-01-02T15:04:05.999Z")) (*tags)["time"] = ircmsg.MakeTagValue(t)
} }
} }