Send an IRC listener user their own TOPIC, MODE and KICK once (closes #143) #177

Merged
clawbot merged 1 commits from issue-143-own-echo-once into next 2026-10-21 06:14:42 +02:00
Collaborator

Fixes #143.

The service sends a TOPIC, MODE or KICK to every channel member, the issuer included, and the IRC listener's TOPIC, MODE and KICK handlers also write it straight to the issuer's connection, so an IRC listener user got each of their own changes twice. deliverTopicChange, deliverKickMsg and deliverMode in internal/ircserver/relay.go now skip a message whose sender is the connection's own nick, with the same exact == check the relay already uses for PRIVMSG, NOTICE, JOIN, PART, NICK and QUIT. The direct echo stays, since it carries the real hostmask and arrives in order.

TestRelayOwnChangeOnce counts the TOPIC, MODE and KICK lines alice and carl each receive. alice sends a PING after her command, and the test then queues a PRIVMSG to each user, so every copy of the change, echoed or relayed, arrives before the end of what the test reads.

README.md MODE ("On the IRC listener") now says the operator gets the line once.

  • Consequence the issue accepts: a TOPIC, MODE or KICK made from another client of the same session (for example over the HTTP API) no longer reaches that session's IRC listener connection, just as a PRIVMSG from that client does not today.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/neoirc/issues/143. The service sends a TOPIC, MODE or KICK to every channel member, the issuer included, and the IRC listener's TOPIC, MODE and KICK handlers also write it straight to the issuer's connection, so an IRC listener user got each of their own changes twice. `deliverTopicChange`, `deliverKickMsg` and `deliverMode` in `internal/ircserver/relay.go` now skip a message whose sender is the connection's own nick, with the same exact `==` check the relay already uses for PRIVMSG, NOTICE, JOIN, PART, NICK and QUIT. The direct echo stays, since it carries the real hostmask and arrives in order. `TestRelayOwnChangeOnce` counts the TOPIC, MODE and KICK lines `alice` and `carl` each receive. `alice` sends a PING after her command, and the test then queues a PRIVMSG to each user, so every copy of the change, echoed or relayed, arrives before the end of what the test reads. `README.md` MODE ("On the IRC listener") now says the operator gets the line once. - Consequence the issue accepts: a TOPIC, MODE or KICK made from another client of the same session (for example over the HTTP API) no longer reaches that session's IRC listener connection, just as a PRIVMSG from that client does not today. Model: opus-5-5
clawbot added the needs-review label 2026-10-21 06:00:37 +02:00
clawbot self-assigned this 2026-10-21 06:00:37 +02:00
clawbot added 1 commit 2026-10-21 06:00:37 +02:00
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
Author
Collaborator

PASS

Model: opus-5-5

**PASS** Model: opus-5-5
clawbot removed the needs-review label 2026-10-21 06:13:17 +02:00
clawbot merged commit 3cbdac7bda into next 2026-10-21 06:14:42 +02:00
clawbot deleted branch issue-143-own-echo-once 2026-10-21 06:14:44 +02:00
Sign in to join this conversation.