Mark bouncer users and BouncerServ as authenticated in WHOX/WHOIS

This commit is contained in:
Simon Ser 2021-11-02 18:32:39 +01:00
parent 241e27b00e
commit 832d8b89a2
2 changed files with 13 additions and 0 deletions

View File

@ -1938,6 +1938,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
Server: dc.srv.Hostname,
Nickname: dc.nick,
Flags: flags,
Account: dc.user.Username,
Realname: dc.realname,
}
dc.SendMessage(generateWHOXReply(dc.srv.prefix(), dc.nick, fields, &info))
@ -1956,6 +1957,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
Server: dc.srv.Hostname,
Nickname: serviceNick,
Flags: "H*",
Account: serviceNick,
Realname: serviceRealname,
}
dc.SendMessage(generateWHOXReply(dc.srv.prefix(), dc.nick, fields, &info))
@ -2021,6 +2023,11 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
Params: []string{dc.nick, dc.nick, "is a bouncer administrator"},
})
}
dc.SendMessage(&irc.Message{
Prefix: dc.srv.prefix(),
Command: rpl_whoisaccount,
Params: []string{dc.nick, dc.nick, dc.user.Username, "is logged in as"},
})
dc.SendMessage(&irc.Message{
Prefix: dc.srv.prefix(),
Command: irc.RPL_ENDOFWHOIS,
@ -2044,6 +2051,11 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
Command: irc.RPL_WHOISOPERATOR,
Params: []string{dc.nick, serviceNick, "is the bouncer service"},
})
dc.SendMessage(&irc.Message{
Prefix: dc.srv.prefix(),
Command: rpl_whoisaccount,
Params: []string{dc.nick, serviceNick, serviceNick, "is logged in as"},
})
dc.SendMessage(&irc.Message{
Prefix: dc.srv.prefix(),
Command: irc.RPL_ENDOFWHOIS,

1
irc.go
View File

@ -18,6 +18,7 @@ const (
rpl_creationtime = "329"
rpl_topicwhotime = "333"
rpl_whospcrpl = "354"
rpl_whoisaccount = "330"
err_invalidcapcmd = "410"
)