From dc26908466255f13b721a3f7610f7b4152303c78 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 17 Mar 2020 16:15:54 +0100 Subject: [PATCH] Fix echo PRIVMSG messages --- downstream.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/downstream.go b/downstream.go index 543559f..409648b 100644 --- a/downstream.go +++ b/downstream.go @@ -252,6 +252,7 @@ func (dc *downstreamConn) writeMessages() error { if ours { // The message comes from our connection, don't echo it // back + consumer.Consume() continue } @@ -903,11 +904,19 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { Params: []string{upstreamName, text}, }) + echoMsg := &irc.Message{ + Prefix: &irc.Prefix{ + Name: uc.nick, + User: uc.username, + }, + Command: "PRIMSG", + Params: []string{upstreamName, text}, + } dc.lock.Lock() - dc.ourMessages[msg] = struct{}{} + dc.ourMessages[echoMsg] = struct{}{} dc.lock.Unlock() - uc.ring.Produce(msg) + uc.ring.Produce(echoMsg) } default: dc.logger.Printf("unhandled message: %v", msg)