From bd8ab7230dc8d60adc3ff51ceea602aa4e494a9a Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 1 May 2020 19:05:20 +0200 Subject: [PATCH] Send service NOTICE on highlight in detached channel --- upstream.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/upstream.go b/upstream.go index f12c509..810156e 100644 --- a/upstream.go +++ b/upstream.go @@ -304,6 +304,13 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { target = msg.Prefix.Name } uc.produce(target, msg, nil) + + highlight := strings.Contains(text, uc.nick) && msg.Prefix.Name != uc.nick + if ch, ok := uc.network.channels[target]; ok && ch.Detached && highlight { + uc.forEachDownstream(func(dc *downstreamConn) { + sendServiceNOTICE(dc, fmt.Sprintf("highlight in %v: <%v> %v", dc.marshalEntity(uc.network, ch.Name), msg.Prefix.Name, text)) + }) + } } case "CAP": var subCmd string