Add WHOIS reply for BouncerServ

This commit is contained in:
Simon Ser 2021-10-06 11:50:12 +02:00
parent 2814512da7
commit 1d56ef19e7

View File

@ -1908,6 +1908,24 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
}) })
return nil return nil
} }
if casemapASCII(mask) == serviceNickCM {
dc.SendMessage(&irc.Message{
Prefix: dc.srv.prefix(),
Command: irc.RPL_WHOISUSER,
Params: []string{dc.nick, serviceNick, servicePrefix.User, servicePrefix.Host, "*", serviceRealname},
})
dc.SendMessage(&irc.Message{
Prefix: dc.srv.prefix(),
Command: irc.RPL_WHOISSERVER,
Params: []string{dc.nick, serviceNick, dc.srv.Hostname, "soju"},
})
dc.SendMessage(&irc.Message{
Prefix: dc.srv.prefix(),
Command: irc.RPL_ENDOFWHOIS,
Params: []string{dc.nick, serviceNick, "End of /WHOIS list"},
})
return nil
}
// TODO: support WHOIS masks // TODO: support WHOIS masks
uc, upstreamNick, err := dc.unmarshalEntity(mask) uc, upstreamNick, err := dc.unmarshalEntity(mask)