mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
remove draft/resume-0.5
This commit is contained in:
parent
df49137aca
commit
ba21987d03
14 changed files with 4 additions and 683 deletions
|
|
@ -420,31 +420,6 @@ func batchHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respon
|
|||
return false
|
||||
}
|
||||
|
||||
// BRB [message]
|
||||
func brbHandler(server *Server, client *Client, msg ircmsg.Message, rb *ResponseBuffer) bool {
|
||||
success, duration := client.brbTimer.Enable()
|
||||
if !success {
|
||||
rb.Add(nil, server.name, "FAIL", "BRB", "CANNOT_BRB", client.t("Your client does not support BRB"))
|
||||
return false
|
||||
} else {
|
||||
rb.Add(nil, server.name, "BRB", strconv.Itoa(int(duration.Seconds())))
|
||||
}
|
||||
|
||||
var message string
|
||||
if 0 < len(msg.Params) {
|
||||
message = msg.Params[0]
|
||||
} else {
|
||||
message = client.t("I'll be right back")
|
||||
}
|
||||
|
||||
if len(client.Sessions()) == 1 {
|
||||
// true BRB
|
||||
rb.session.SetAway(message)
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// CAP <subcmd> [<caps>]
|
||||
func capHandler(server *Server, client *Client, msg ircmsg.Message, rb *ResponseBuffer) bool {
|
||||
details := client.Details()
|
||||
|
|
@ -540,15 +515,6 @@ func capHandler(server *Server, client *Client, msg ircmsg.Message, rb *Response
|
|||
rb.session.capabilities.Subtract(toRemove)
|
||||
rb.Add(nil, server.name, "CAP", details.nick, "ACK", capString)
|
||||
|
||||
// if this is the first time the client is requesting a resume token,
|
||||
// send it to them
|
||||
if toAdd.Has(caps.Resume) {
|
||||
token, id := server.resumeManager.GenerateToken(client)
|
||||
if token != "" {
|
||||
rb.Add(nil, server.name, "RESUME", "TOKEN", token)
|
||||
rb.session.SetResumeID(id)
|
||||
}
|
||||
}
|
||||
case "END":
|
||||
if !client.registered {
|
||||
rb.session.capState = caps.NegotiatedState
|
||||
|
|
@ -2809,30 +2775,6 @@ func renameHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respo
|
|||
return false
|
||||
}
|
||||
|
||||
// RESUME <token> [timestamp]
|
||||
func resumeHandler(server *Server, client *Client, msg ircmsg.Message, rb *ResponseBuffer) bool {
|
||||
details := ResumeDetails{
|
||||
PresentedToken: msg.Params[0],
|
||||
}
|
||||
|
||||
if client.registered {
|
||||
rb.Add(nil, server.name, "FAIL", "RESUME", "REGISTRATION_IS_COMPLETED", client.t("Cannot resume connection, connection registration has already been completed"))
|
||||
return false
|
||||
}
|
||||
|
||||
if 1 < len(msg.Params) {
|
||||
ts, err := time.Parse(IRCv3TimestampFormat, msg.Params[1])
|
||||
if err == nil {
|
||||
details.Timestamp = ts
|
||||
} else {
|
||||
rb.Add(nil, server.name, "WARN", "RESUME", "HISTORY_LOST", client.t("Timestamp is not in 2006-01-02T15:04:05.999Z format, ignoring it"))
|
||||
}
|
||||
}
|
||||
|
||||
rb.session.resumeDetails = &details
|
||||
return false
|
||||
}
|
||||
|
||||
// SANICK <oldnick> <nickname>
|
||||
func sanickHandler(server *Server, client *Client, msg ircmsg.Message, rb *ResponseBuffer) bool {
|
||||
targetNick := msg.Params[0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue