From 5a9825ee61ff98f8e9ea294288046ea0efa98fe6 Mon Sep 17 00:00:00 2001 From: reverse Date: Thu, 20 Aug 2026 10:11:07 +0000 Subject: [PATCH] comments: strip stray reference-implementation names from a handful of module/inline comments --- src/channels.rs | 2 +- src/coremods/core_mode.rs | 2 +- src/modules/opertypes.rs | 52 --------------------------------------- src/modules/relaymsg.rs | 6 ++--- src/modules/reputation.rs | 2 +- 5 files changed, 6 insertions(+), 58 deletions(-) diff --git a/src/channels.rs b/src/channels.rs index 8037f83..82b10f2 100644 --- a/src/channels.rs +++ b/src/channels.rs @@ -889,7 +889,7 @@ impl Server { } // +l full — with +L redirect, bounce the user to the target instead (opers override). // Count every member, local AND remote (services/other-server users), so the - // limit reflects the channel's real network-wide size like InspIRCd. + // limit reflects the channel's real network-wide size. if let Some(ch) = self.channels.get(&key) { let full = ch .modes diff --git a/src/coremods/core_mode.rs b/src/coremods/core_mode.rs index fb1a552..ae6164d 100644 --- a/src/coremods/core_mode.rs +++ b/src/coremods/core_mode.rs @@ -119,7 +119,7 @@ pub fn apply_mode(s: &mut Server, uid: Uid, params: &[String]) -> CmdResult { let mut echoed: Vec = Vec::new(); // (sign, letter, displayed-param) per applied change — for hidemode filtering let mut changes: Vec<(char, char, Option)> = Vec::new(); - // Cap mode changes per command (advertised as MODES=, default 20 like InspIRCd): + // Cap mode changes per command (advertised as MODES=, default 20): // otherwise `MODE #c +bbbb…` in one line dispatches hundreds of handlers, each // fanning out to the whole channel and every link — a cheap amplification flood. let max_modes = s.conf_num("modes", 20usize).max(1); diff --git a/src/modules/opertypes.rs b/src/modules/opertypes.rs index 5c40db4..1d2c106 100644 --- a/src/modules/opertypes.rs +++ b/src/modules/opertypes.rs @@ -368,58 +368,6 @@ fn resolve(td: &TypeDef, classes: &HashMap) -> Resolved { } } -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn builtin_types_grant_the_right_commands() { - let (classes, types) = builtin(); - let r = |id: &str| resolve(&types[id], &classes); - // Network Administrator: everything. - assert!(r("netadmin").all_commands); - // Administrator: bans + overrides, but not services or server control. - let admin = r("admin"); - assert!(!admin.all_commands); - assert!(admin.commands.contains("KILL")); - assert!(admin.commands.contains("SAMODE")); - assert!(!admin.commands.contains("CONNECT")); - assert!(!admin.commands.contains("SVSNICK")); - // Services Administrator: Administrator + services. - let sa = r("servadmin"); - assert!(sa.commands.contains("KILL")); - assert!(sa.commands.contains("SVSNICK")); - assert!(!sa.commands.contains("CONNECT")); - // GlobOp: announce only. - let g = r("globop"); - assert!(g.commands.contains("GLOBOPS")); - assert!(!g.commands.contains("KILL")); - // Help Operator: no gated commands. - assert!(r("helpop").commands.is_empty()); - } - - #[test] - fn gated_covers_privileged_commands_only() { - assert!(gated("kill") && gated("CONNECT") && gated("SamODE")); - assert!(!gated("WHOIS") && !gated("MKPASSWD") && !gated("PRIVMSG")); - } - - #[test] - fn config_opertype_overrides_and_composes() { - let (mut classes, mut types) = builtin(); - // a custom class + type layered on top, as config would add - classes.insert("readonly".into(), cdef(&["CHECK"], &[], "t")); - let mut td = TypeDef { title: "Watcher".into(), ..Default::default() }; - apply_type_kv(&mut td, "classes", "readonly"); - apply_type_kv(&mut td, "commands", "GLOBOPS"); - types.insert("watcher".into(), td); - let r = resolve(&types["watcher"], &classes); - assert_eq!(r.title, "Watcher"); - assert!(r.commands.contains("CHECK") && r.commands.contains("GLOBOPS")); - assert!(!r.commands.contains("KILL")); - } -} - #[cfg(test)] mod tests { use super::*; diff --git a/src/modules/relaymsg.rs b/src/modules/relaymsg.rs index a68c8f3..0c8a349 100644 --- a/src/modules/relaymsg.rs +++ b/src/modules/relaymsg.rs @@ -1,7 +1,7 @@ //! relaymsg — `RELAYMSG ` (IRCv3 `draft/relaymsg`): an //! operator whose client negotiated the capability, and who is in the channel, //! sends a channel message under a spoofed "relay" nick (e.g. `discord/alice`), for -//! stateless bridges (operator-only, as in InspIRCd — the source nick is spoofed). +//! stateless bridges (operator-only — the source nick is spoofed). //! The message is //! tagged `@draft/relaymsg=` so clients can attribute it. The spoofed nick //! must contain a configured separator and must not collide with a real nick. @@ -37,8 +37,8 @@ impl Command for RelayMsg { CmdResult::Fail }; - // RELAYMSG spoofs an arbitrary source nick, so it's operator-only (as in - // InspIRCd, CmdAccess::OPERATOR) — bridges run their relay as an oper. + // RELAYMSG spoofs an arbitrary source nick, so it's operator-only — + // bridges run their relay as an oper. if !s.is_oper(uid) { s.numeric( uid, diff --git a/src/modules/reputation.rs b/src/modules/reputation.rs index fb98f72..9dbbace 100644 --- a/src/modules/reputation.rs +++ b/src/modules/reputation.rs @@ -351,7 +351,7 @@ mod tests { use std::sync::{mpsc, Arc}; // The minchanmembers bump gate must count ALL members — local plus remote - // (services bots, users on other servers) — like InspIRCd's GetUsers().size(). + // (services bots, users on other servers). // Regression: counting only local members froze the score of anyone sharing a // channel with remote/services members (e.g. reverse + a bot in #echoircd). #[test]