feat: implement IRC numerics batch 2 — connection registration, channel ops, user queries (#59)
All checks were successful
check / check (push) Successful in 5s
All checks were successful
check / check (push) Successful in 5s
## Summary Implements the remaining important/commonly-used IRC numeric reply codes, as requested in [issue #52](#52). ### Connection Registration (001-005) - **002 RPL_YOURHOST** — "Your host is <server>, running version <ver>" - **003 RPL_CREATED** — "This server was created <date>" - **004 RPL_MYINFO** — "<server> <version> <usermodes> <chanmodes>" - **005 RPL_ISUPPORT** — CHANTYPES=#, NICKLEN=32, CHANMODES, NETWORK=neoirc, CASEMAPPING=ascii All sent automatically after RPL_WELCOME during session creation/login. ### Server Statistics (251-255) - **251 RPL_LUSERCLIENT** — user count - **252 RPL_LUSEROP** — operator count - **254 RPL_LUSERCHANNELS** — channel count - **255 RPL_LUSERME** — local client count Sent during connection registration and available via LUSERS command. ### Channel Operations - **MODE command** — query channel modes (324 RPL_CHANNELMODEIS + 329 RPL_CREATIONTIME) and user modes (221 RPL_UMODEIS) - **NAMES command** — query channel member list (reuses 353/366) - **LIST command** — list all channels with member counts (322 RPL_LIST + 323 end) ### User Queries - **WHOIS command** — 311 RPL_WHOISUSER, 312 RPL_WHOISSERVER, 319 RPL_WHOISCHANNELS, 318 RPL_ENDOFWHOIS - **WHO command** — 352 RPL_WHOREPLY, 315 RPL_ENDOFWHO ### Database Additions - `GetChannelCount()` — total channel count for LUSERS - `ListAllChannelsWithCounts()` — channels with member counts for LIST - `GetChannelCreatedAt()` — channel creation time for RPL_CREATIONTIME - `GetSessionCreatedAt()` — session creation time ### Other Changes - Added `StartTime` to `Globals` struct for RPL_CREATED - Updated README with comprehensive documentation of all new commands and numerics - Updated roadmap to reflect implemented features `docker build .` passes (lint, tests, build all green). closes [#52](#52) <!-- session: agent:sdlc-manager:subagent:1f3dcab8-ad6a-4c4c-af72-34a617640c9d --> Co-authored-by: clawbot <clawbot@noreply.git.eeqj.de> Co-authored-by: clawbot <clawbot@git.eeqj.de> Reviewed-on: #59 Co-authored-by: clawbot <sneak+clawbot@sneak.cloud> Co-committed-by: clawbot <sneak+clawbot@sneak.cloud>
This commit was merged in pull request #59.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -12,6 +12,7 @@ import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
@@ -115,8 +116,9 @@ func newTestServer(
|
||||
|
||||
func newTestGlobals() *globals.Globals {
|
||||
return &globals.Globals{
|
||||
Appname: "neoirc-test",
|
||||
Version: "test",
|
||||
Appname: "neoirc-test",
|
||||
Version: "test",
|
||||
StartTime: time.Now(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,8 +468,11 @@ func findNumeric(
|
||||
msgs []map[string]any,
|
||||
numeric string,
|
||||
) bool {
|
||||
want, _ := strconv.Atoi(numeric)
|
||||
|
||||
for _, msg := range msgs {
|
||||
if msg[commandKey] == numeric {
|
||||
code, ok := msg["code"].(float64)
|
||||
if ok && int(code) == want {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user