From 55174ec017d2897bf3b358bbec8b4a41771bf949 Mon Sep 17 00:00:00 2001 From: reverse Date: Wed, 19 Aug 2026 01:33:05 +0000 Subject: [PATCH] profilelink/hidelist: unify the WHOIS label to English "Profile:" (was "Profil:" for logged-in users) and make hidelist honour the last matching config line (conf last-wins semantics) instead of the first --- src/modules/hidelist.rs | 9 +++++++-- src/modules/profilelink.rs | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/modules/hidelist.rs b/src/modules/hidelist.rs index 35c280f..04abf57 100644 --- a/src/modules/hidelist.rs +++ b/src/modules/hidelist.rs @@ -23,13 +23,18 @@ pub fn denied(s: &Server, uid: Uid, key: &str, modechar: char) -> bool { if s.is_oper(uid) { return false; } + // last matching line wins, mirroring conf()'s last-value-overrides semantics + let mut req: Option = None; for line in s.conf_all("hidelist") { let mut it = line.split_whitespace(); if let (Some(mc), Some(rank)) = (it.next(), it.next()) { if mc.chars().next() == Some(modechar) { - return s.rank(uid, key) < rank_value(rank); + req = Some(rank_value(rank)); } } } - false + match req { + Some(r) => s.rank(uid, key) < r, + None => false, + } } diff --git a/src/modules/profilelink.rs b/src/modules/profilelink.rs index 8d873ed..953ba34 100644 --- a/src/modules/profilelink.rs +++ b/src/modules/profilelink.rs @@ -9,7 +9,7 @@ pub fn line(s: &Server, account: &Option) -> Option { return None; } Some(match account { - Some(acct) => format!("Profil: {base}{acct}"), + Some(acct) => format!("Profile: {base}{acct}"), None => "Profile: The user is not logged in or the account is not registered.".to_string(), }) }