Complete IRC numerics module and move to pkg/irc/ (refs #52) #71

Merged
sneak merged 5 commits from feat/complete-irc-numerics into main 2026-03-10 18:41:27 +01:00

5 Commits

Author SHA1 Message Date
clawbot
eeb0f29465 test: add comprehensive tests for IRCMessageType API
All checks were successful
check / check (push) Successful in 4s
Cover Name(), String(), Code(), Int(), FromInt() for known and unknown
numerics, plus the deprecated Name() package-level function.
100% statement coverage on pkg/irc.
2026-03-10 10:38:56 -07:00
user
ba2c113a85 refactor: rename MessageType to IRCMessageType with full API
All checks were successful
check / check (push) Successful in 4s
- Rename MessageType to IRCMessageType (custom int type)
- .Name() returns just the name (e.g. "RPL_LUSEROP")
- .String() returns name + code (e.g. "RPL_LUSEROP <252>")
- .Code() returns zero-padded 3-digit string (e.g. "252")
- .Int() returns the bare int value
- Add FromInt() package-level function with validation
- Update all call sites to use new type and methods
2026-03-10 10:31:22 -07:00
clawbot
164fec3fc8 refactor: add irc.MessageType custom type with Name() and String() methods
All checks were successful
check / check (push) Successful in 2m28s
- Create 'type MessageType int' in pkg/irc/numerics.go
- Type all Rpl*/Err* numeric constants as MessageType
- Add Name() method returning the standard IRC name (e.g. RPL_WELCOME)
- Add String() method returning zero-padded numeric (e.g. 001)
- Update enqueueNumeric/respondIRCError to accept MessageType
- Update internal/db to use MessageType conversion for Name() calls
- Change names map key type from int to MessageType

Refs #52
2026-03-10 10:17:57 -07:00
user
fa347772f2 Add missing RFC 2812 numerics: RPL_STATSQLINE (217), RPL_STATSLLINE (241), RPL_STATSHLINE (244)
All checks were successful
check / check (push) Successful in 4s
2026-03-10 10:12:46 -07:00
clawbot
53a824c01b Complete IRC numerics module and move to pkg/irc/ (refs #52)
All checks were successful
check / check (push) Successful in 2m18s
- Add all missing numeric reply codes from RFC 1459 and RFC 2812
- Move irc package from internal/irc/ to pkg/irc/ for external use
- Update all imports throughout the codebase
- Added: trace replies (200-209), stats replies (211-219, 242-243),
  admin replies (256-259), service replies (234-235), WHOWAS (314, 369),
  list start (321), version (351), links (364-365), info (371, 374),
  oper/rehash/service (381-383), time/users (391-395),
  invite/except lists (346-349), unique ops (325),
  and all missing error codes (406-415, 422-424, 436-437, 443-446,
  463-467, 472, 476-478, 481, 483-485, 491, 501-502)
2026-03-10 10:06:57 -07:00