Use downstreamConn.upstreamForCommand when handling user MODE
Provides uniform error messages.
This commit is contained in:
parent
d6fc01e44a
commit
fe64c795cd
@ -2012,15 +2012,11 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc.
|
||||
|
||||
if dc.casemap(name) == dc.nickCM {
|
||||
if modeStr != "" {
|
||||
if uc := dc.upstream(); uc != nil {
|
||||
uc.SendMessageLabeled(ctx, dc.id, msg)
|
||||
} else {
|
||||
dc.SendMessage(ctx, &irc.Message{
|
||||
Prefix: dc.srv.prefix(),
|
||||
Command: irc.ERR_UMODEUNKNOWNFLAG,
|
||||
Params: []string{dc.nick, "Cannot change user mode on bouncer connection"},
|
||||
})
|
||||
uc, err := dc.upstreamForCommand(msg.Command)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
uc.SendMessageLabeled(ctx, dc.id, msg)
|
||||
} else {
|
||||
var userMode string
|
||||
if uc := dc.upstream(); uc != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user