fix: address 3 blocking review findings for IRC protocol listener
All checks were successful
check / check (push) Successful in 59s

1. ISUPPORT/applyChannelModes: extend IRC MODE handler to support +i/-i,
   +s/-s, +n/-n (routed through svc.SetChannelFlag), and +H/-H (hashcash
   bits with parameter parsing). Add 'n' (no external messages) as a
   proper DB-backed channel flag with is_no_external column (default: on).
   Update IRC ISUPPORT to CHANMODES=,,H,imnst to match actual support.

2. QueryChannelMode: rewrite to return complete mode string including all
   boolean flags (n, i, m, s, t) and parameterized modes (k, l, H),
   matching the HTTP handler's buildChannelModeString logic. Simplify
   buildChannelModeString to delegate to QueryChannelMode for consistency.

3. Service struct encapsulation: change exported fields (DB, Broker,
   Config, Log) to unexported (db, broker, config, log). Add NewTestService
   constructor for use by external test packages. Update ircserver
   export_test.go to use the new constructor.

Closes #89
This commit is contained in:
user
2026-03-28 11:48:01 -07:00
parent 260f798af4
commit f57a373053
7 changed files with 357 additions and 175 deletions

View File

@@ -44,6 +44,7 @@ CREATE TABLE IF NOT EXISTS channels (
is_topic_locked INTEGER NOT NULL DEFAULT 1,
is_invite_only INTEGER NOT NULL DEFAULT 0,
is_secret INTEGER NOT NULL DEFAULT 0,
is_no_external INTEGER NOT NULL DEFAULT 1,
channel_key TEXT NOT NULL DEFAULT '',
user_limit INTEGER NOT NULL DEFAULT 0,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,