Send an IRC listener user their own TOPIC, MODE and KICK once (closes #143)
check / check (push) Canceled after 0s

The service sends a TOPIC, MODE or KICK to every channel member, the
issuer included, and the IRC listener also echoes it to the issuer's
connection, so an IRC listener user got each of their own changes
twice. The relay now drops one whose sender is the connection's own
nick, as it already does for PRIVMSG, NOTICE, JOIN, PART, NICK and
QUIT. The direct echo stays: it carries the real hostmask and arrives
in order. The README MODE section no longer describes a second copy.

Model: opus-5-5
This commit was merged in pull request #177.
This commit is contained in:
2026-10-21 06:14:42 +02:00
parent d37c130ee8
commit 3cbdac7bda
3 changed files with 96 additions and 3 deletions
+27
View File
@@ -304,6 +304,15 @@ func (c *Conn) deliverTopicChange(
msg *db.IRCMessage,
text string,
) {
c.mu.Lock()
nick := c.nick
c.mu.Unlock()
// handleTopic already echoed our own topic change.
if msg.From == nick {
return
}
prefix := msg.From + "!" + msg.From + "@*"
channel := msg.To
@@ -315,6 +324,15 @@ func (c *Conn) deliverKickMsg(
msg *db.IRCMessage,
text string,
) {
c.mu.Lock()
nick := c.nick
c.mu.Unlock()
// handleKick already echoed our own kick.
if msg.From == nick {
return
}
prefix := msg.From + "!" + msg.From + "@*"
channel := msg.To
@@ -377,6 +395,15 @@ func (c *Conn) deliverMode(
return
}
c.mu.Lock()
nick := c.nick
c.mu.Unlock()
// applyChannelModes already echoed our own mode change.
if msg.From == nick {
return
}
prefix := msg.From + "!" + msg.From + "@*"
params := slices.Concat(