diff --git a/irc/getters.go b/irc/getters.go index f4b86391..6031659f 100644 --- a/irc/getters.go +++ b/irc/getters.go @@ -4,6 +4,7 @@ package irc import ( + "fmt" "net" "sync/atomic" "time" @@ -493,7 +494,7 @@ func (client *Client) GetReadMarker(cfname string) (result string) { t, ok := client.readMarkers[cfname] client.stateMutex.RUnlock() if ok { - return t.Format(IRCv3TimestampFormat) + return fmt.Sprintf("timestamp=%s", t.Format(IRCv3TimestampFormat)) } return "*" } diff --git a/irc/handlers.go b/irc/handlers.go index 75f2d54f..43cd00f8 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -2770,14 +2770,14 @@ func markReadHandler(server *Server, client *Client, msg ircmsg.Message, rb *Res } // "MARKREAD client set command": MARKREAD - readTimestamp := msg.Params[1] + readTimestamp := strings.TrimPrefix(msg.Params[1], "timestamp=") readTime, err := time.Parse(IRCv3TimestampFormat, readTimestamp) if err != nil { rb.Add(nil, server.name, "FAIL", "MARKREAD", "INVALID_PARAMS", utils.SafeErrorParam(readTimestamp), client.t("Invalid timestamp")) return } result := client.SetReadMarker(cftarget, readTime) - readTimestamp = result.Format(IRCv3TimestampFormat) + readTimestamp = fmt.Sprintf("timestamp=%s", result.Format(IRCv3TimestampFormat)) // inform the originating session whether it was a success or a no-op: rb.Add(nil, server.name, "MARKREAD", unfoldedTarget, readTimestamp) if result.Equal(readTime) {