- Create internal/irc/ package with all IRC numeric reply codes (RFC 1459/2812)
and command string constants as the single source of truth
- Replace all 69+ bare numeric string literals in api.go with named constants
(e.g. irc.RplWelcome, irc.ErrNoSuchChannel)
- Add 'code' (int) and named 'command' (e.g. RPL_YOURHOST) fields to IRC
message JSON replies via irc.Name() lookup in scanMessages
- Deduplicate command constants: remove local definitions from api.go,
cmd/neoirc-cli/main.go, and cmd/neoirc-cli/api/client.go; all now import
from internal/irc
- Fix dead code: remove handleListCmd/handleWhoCmd/handleWhoisCmd/
sendWhoisNumerics that were unreachable due to dispatchCommand routing
LIST/WHO/WHOIS to dispatchInfoCommand before dispatchQueryCommand.
Route these commands to dispatchQueryCommand which has the improved
implementations (e.g. ListAllChannelsWithCounts single-query vs N+1)
- Update enqueueNumeric and respondIRCError signatures from string to int
- Update test helper findNumeric to check the new 'code' JSON field
Closes#52
Extract cmdLusers, cmdMode, cmdMotd, cmdNames, cmdNotice, cmdPing, cmdPong
constants in internal/handlers/api.go. Add corresponding constants in
cmd/neoirc-cli/main.go and cmd/neoirc-cli/api/client.go. Replace every bare
IRC command string literal in switch cases and command dispatch code with the
named constant. Zero bare command strings remain in any dispatch path.