Reply to WHO BouncerServ

Closes: https://todo.sr.ht/~emersion/soju/75
This commit is contained in:
Simon Ser 2020-06-29 18:09:48 +02:00
parent d26194f62d
commit 90250f5be5
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
3 changed files with 15 additions and 1 deletions

View File

@ -1336,6 +1336,19 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
}) })
return nil return nil
} }
if entity == serviceNick {
dc.SendMessage(&irc.Message{
Prefix: dc.srv.prefix(),
Command: irc.RPL_WHOREPLY,
Params: []string{serviceNick, "*", servicePrefix.User, servicePrefix.Host, dc.srv.Hostname, serviceNick, "H", "0 " + serviceRealname},
})
dc.SendMessage(&irc.Message{
Prefix: dc.srv.prefix(),
Command: irc.RPL_ENDOFWHO,
Params: []string{dc.nick, serviceNick, "End of /WHO list"},
})
return nil
}
uc, upstreamName, err := dc.unmarshalEntity(entity) uc, upstreamName, err := dc.unmarshalEntity(entity)
if err != nil { if err != nil {

View File

@ -27,6 +27,7 @@ import (
) )
const serviceNick = "BouncerServ" const serviceNick = "BouncerServ"
const serviceRealname = "soju bouncer service"
var servicePrefix = &irc.Prefix{ var servicePrefix = &irc.Prefix{
Name: serviceNick, Name: serviceNick,

View File

@ -1337,7 +1337,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
// Ignore // Ignore
case irc.ERR_PASSWDMISMATCH, irc.ERR_ERRONEUSNICKNAME, irc.ERR_NICKNAMEINUSE, irc.ERR_NICKCOLLISION, irc.ERR_UNAVAILRESOURCE: case irc.ERR_PASSWDMISMATCH, irc.ERR_ERRONEUSNICKNAME, irc.ERR_NICKNAMEINUSE, irc.ERR_NICKCOLLISION, irc.ERR_UNAVAILRESOURCE:
if !uc.registered { if !uc.registered {
return fmt.Errorf("registration failed: %v", msg.Params[len(msg.Params) - 1]) return fmt.Errorf("registration failed: %v", msg.Params[len(msg.Params)-1])
} }
fallthrough fallthrough
default: default: