Make user MODE commands fail in multi-upstream mode
References: https://todo.sr.ht/~emersion/soju/20
This commit is contained in:
parent
0e9ef1f97c
commit
2b3782a507
@ -1601,12 +1601,18 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
|
|||||||
|
|
||||||
if casemapASCII(name) == dc.nickCM {
|
if casemapASCII(name) == dc.nickCM {
|
||||||
if modeStr != "" {
|
if modeStr != "" {
|
||||||
dc.forEachUpstream(func(uc *upstreamConn) {
|
if uc := dc.upstream(); uc != nil {
|
||||||
uc.SendMessageLabeled(dc.id, &irc.Message{
|
uc.SendMessageLabeled(dc.id, &irc.Message{
|
||||||
Command: "MODE",
|
Command: "MODE",
|
||||||
Params: []string{uc.nick, modeStr},
|
Params: []string{uc.nick, modeStr},
|
||||||
})
|
})
|
||||||
})
|
} else {
|
||||||
|
dc.SendMessage(&irc.Message{
|
||||||
|
Prefix: dc.srv.prefix(),
|
||||||
|
Command: irc.ERR_UMODEUNKNOWNFLAG,
|
||||||
|
Params: []string{dc.nick, "Cannot change user mode in multi-upstream mode"},
|
||||||
|
})
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
var userMode string
|
var userMode string
|
||||||
if uc := dc.upstream(); uc != nil {
|
if uc := dc.upstream(); uc != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user