neoirc-cli hides what its session does from other clients and shows its own join twice #186

Open
opened 2026-10-21 14:23:27 +02:00 by clawbot · 0 comments
Collaborator

In internal/cli/app.go, neoirc-cli writes its own line when it sends a message, joins or parts (*** Joined #chan, *** Left #chan, its own message text), and drops the server's event when it comes from its own nick (handlePrivmsgEvent, and with #183 also handlePartEvent). Its own JOIN event is not dropped, so a join shows twice: *** Joined #chan, then *** nick has joined #chan. Dropping by nick also drops what the same session sends or does from another client (the web client or an IRC listener connection), which README.md (Multi-Client Model) says every client of the session receives. Read from the code on d539b4c and #183.

With #183, the HTTP API queues the sender's own PRIVMSG, NOTICE, JOIN and PART to every client of its session, the sending client included, so the server's event is the one copy.

Fix: neoirc-cli shows its own PRIVMSG, NOTICE, JOIN and PART from the server's event, as it shows everyone else's, and stops writing its own copy when it sends; nothing is dropped by nick. Error lines for a failed send, join or part stay. A part made from neoirc-cli does not mark the channel it left as unread. Change nothing else.

Definition of done

  1. A message, join or part made from neoirc-cli shows exactly once in its buffer.
  2. A message, join or part the same session makes from another client shows once in neoirc-cli.
  3. The channel neoirc-cli parts is not marked unread.
  4. Tests in internal/cli for items 1 to 3.
  5. One reviewed PR against next, cut after #183 has landed.

Model: opus-5-5

In `internal/cli/app.go`, neoirc-cli writes its own line when it sends a message, joins or parts (`*** Joined #chan`, `*** Left #chan`, its own message text), and drops the server's event when it comes from its own nick (`handlePrivmsgEvent`, and with https://git.eeqj.de/sneak/neoirc/pulls/183 also `handlePartEvent`). Its own `JOIN` event is not dropped, so a join shows twice: `*** Joined #chan`, then `*** nick has joined #chan`. Dropping by nick also drops what the same session sends or does from another client (the web client or an IRC listener connection), which `README.md` (Multi-Client Model) says every client of the session receives. Read from the code on `d539b4c` and https://git.eeqj.de/sneak/neoirc/pulls/183. With https://git.eeqj.de/sneak/neoirc/pulls/183, the HTTP API queues the sender's own PRIVMSG, NOTICE, JOIN and PART to every client of its session, the sending client included, so the server's event is the one copy. Fix: neoirc-cli shows its own PRIVMSG, NOTICE, JOIN and PART from the server's event, as it shows everyone else's, and stops writing its own copy when it sends; nothing is dropped by nick. Error lines for a failed send, join or part stay. A part made from neoirc-cli does not mark the channel it left as unread. Change nothing else. ## Definition of done 1. A message, join or part made from neoirc-cli shows exactly once in its buffer. 2. A message, join or part the same session makes from another client shows once in neoirc-cli. 3. The channel neoirc-cli parts is not marked unread. 4. Tests in `internal/cli` for items 1 to 3. 5. One reviewed PR against `next`, cut after https://git.eeqj.de/sneak/neoirc/pulls/183 has landed. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/neoirc#186