Add downstream NOTICE support

This commit is contained in:
delthas 2020-03-26 06:20:28 +01:00 committed by Simon Ser
parent 9530df5db0
commit 764b54da59
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
1 changed files with 17 additions and 0 deletions

View File

@ -1236,6 +1236,23 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
uc.network.ring.Produce(echoMsg) uc.network.ring.Produce(echoMsg)
} }
case "NOTICE":
var targetsStr, text string
if err := parseMessageParams(msg, &targetsStr, &text); err != nil {
return err
}
for _, name := range strings.Split(targetsStr, ",") {
uc, upstreamName, err := dc.unmarshalEntity(name)
if err != nil {
return err
}
uc.SendMessage(&irc.Message{
Command: "NOTICE",
Params: []string{upstreamName, text},
})
}
case "INVITE": case "INVITE":
var user, channel string var user, channel string
if err := parseMessageParams(msg, &user, &channel); err != nil { if err := parseMessageParams(msg, &user, &channel); err != nil {