1
0
Fork 0
forked from External/ergo

Fix some issues, add RPL_WHOISACCOUNT

This commit is contained in:
Daniel Oaks 2018-01-21 12:23:47 +10:00
parent ac99e82192
commit 0d5327de8a
3 changed files with 19 additions and 5 deletions

View file

@ -1002,6 +1002,10 @@ func (client *Client) getWhoisOf(target *Client) {
if target.flags[TLS] {
client.Send(nil, client.server.name, RPL_WHOISSECURE, client.nick, target.nick, "is using a secure connection")
}
accountName := target.AccountName()
if accountName != "" {
client.Send(nil, client.server.name, RPL_WHOISACCOUNT, client.nick, accountName, "is logged in as")
}
if target.flags[Bot] {
client.Send(nil, client.server.name, RPL_WHOISBOT, client.nick, target.nick, ircfmt.Unescape("is a $bBot$b on ")+client.server.networkName)
}
@ -2093,8 +2097,10 @@ func resumeHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
var timestamp *time.Time
if 1 < len(msg.Params) {
timestamp, err = time.Parse("2006-01-02T15:04:05.999Z", msg.Params[1])
if err != nil {
ts, err := time.Parse("2006-01-02T15:04:05.999Z", msg.Params[1])
if err == nil {
timestamp = &ts
} else {
client.Send(nil, server.name, ERR_CANNOT_RESUME, oldnick, "Timestamp is not in 2006-01-02T15:04:05.999Z format, ignoring it")
}
}
@ -2104,7 +2110,7 @@ func resumeHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
Timestamp: timestamp,
}
return true
return false
}
// USERHOST <nickname> [<nickname> <nickname> ...]