|
@@ -2359,27 +2359,24 @@ func renameHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Re
|
2359
|
2359
|
return false
|
2360
|
2360
|
}
|
2361
|
2361
|
|
2362
|
|
-// RESUME <token> [timestamp]
|
|
2362
|
+// RESUME <token> <timestamp>
|
2363
|
2363
|
func resumeHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
|
2364
|
|
- details := ResumeDetails{
|
2365
|
|
- PresentedToken: msg.Params[0],
|
2366
|
|
- }
|
2367
|
|
-
|
2368
|
2364
|
if client.registered {
|
2369
|
2365
|
rb.Add(nil, server.name, "FAIL", "RESUME", "REGISTRATION_IS_COMPLETED", client.t("Cannot resume connection, connection registration has already been completed"))
|
2370
|
2366
|
return false
|
2371
|
2367
|
}
|
2372
|
2368
|
|
2373
|
|
- if 1 < len(msg.Params) {
|
2374
|
|
- ts, err := time.Parse(IRCv3TimestampFormat, msg.Params[1])
|
2375
|
|
- if err == nil {
|
2376
|
|
- details.Timestamp = ts
|
2377
|
|
- } else {
|
2378
|
|
- rb.Add(nil, server.name, "WARN", "RESUME", "HISTORY_LOST", client.t("Timestamp is not in 2006-01-02T15:04:05.999Z format, ignoring it"))
|
2379
|
|
- }
|
|
2369
|
+ ts, err := time.Parse(IRCv3TimestampFormat, msg.Params[1])
|
|
2370
|
+ if err != nil {
|
|
2371
|
+ rb.Add(nil, server.name, "FAIL", "RESUME", "INVALID_TIMESTAMP", client.t("Cannot resume connection, timestamp is not valid"))
|
|
2372
|
+ return false
|
|
2373
|
+ }
|
|
2374
|
+
|
|
2375
|
+ rb.session.resumeDetails = &ResumeDetails{
|
|
2376
|
+ PresentedToken: msg.Params[0],
|
|
2377
|
+ Timestamp: ts,
|
2380
|
2378
|
}
|
2381
|
2379
|
|
2382
|
|
- rb.session.resumeDetails = &details
|
2383
|
2380
|
return false
|
2384
|
2381
|
}
|
2385
|
2382
|
|