upstream: handle CAP ACK -name

We'll need this for echo-message.
This commit is contained in:
delthas 2022-04-11 17:20:51 +02:00 committed by Simon Ser
parent f7a468194d
commit 12577c10bb

View File

@ -543,7 +543,12 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err
caps := strings.Fields(subParams[0]) caps := strings.Fields(subParams[0])
for _, name := range caps { for _, name := range caps {
if err := uc.handleCapAck(ctx, strings.ToLower(name), subCmd == "ACK"); err != nil { enable := subCmd == "ACK"
if strings.HasPrefix(name, "-") {
name = strings.TrimPrefix(name, "-")
enable = false
}
if err := uc.handleCapAck(ctx, strings.ToLower(name), enable); err != nil {
return err return err
} }
} }