From 12577c10bb5af7f21cc234e918fb668ea318115b Mon Sep 17 00:00:00 2001 From: delthas Date: Mon, 11 Apr 2022 17:20:51 +0200 Subject: [PATCH] upstream: handle CAP ACK -name We'll need this for echo-message. --- upstream.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/upstream.go b/upstream.go index 37dfd9f..cbb9af6 100644 --- a/upstream.go +++ b/upstream.go @@ -543,7 +543,12 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err caps := strings.Fields(subParams[0]) 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 } }