From dadbff91d84b303c0075804313e5d78ec3183132 Mon Sep 17 00:00:00 2001 From: reverse Date: Sun, 16 Aug 2026 18:21:32 +0000 Subject: [PATCH] xline: accept the durationless KLINE/GLINE form (mask :reason) instead of eating the reason --- src/coremods/core_oper.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/coremods/core_oper.rs b/src/coremods/core_oper.rs index 7adc94e..d197e83 100644 --- a/src/coremods/core_oper.rs +++ b/src/coremods/core_oper.rs @@ -679,11 +679,18 @@ fn do_xline(s: &mut Server, uid: Uid, params: &[String], kind: XKind) -> CmdResu ); return CmdResult::Ok; } - let dur = parse_duration(¶ms[1]).unwrap_or(0); - let reason = params - .get(2) - .cloned() - .unwrap_or_else(|| "No reason given".to_string()); + // :; tolerate the durationless form by taking an + // unparseable second token as the reason (permanent ban). + let (dur, reason) = match parse_duration(¶ms[1]) { + Some(d) => ( + d, + params + .get(2) + .cloned() + .unwrap_or_else(|| "No reason given".to_string()), + ), + None => (0, params[1].clone()), + }; s.add_xline(kind, &mask, dur, &nick, &reason); s.propagate_addline(kind.tag(), &mask, &nick, dur, &reason); CmdResult::Ok