add callerid (+g) with ACCEPT allow-list, plus msgid and extended-monitor

This commit is contained in:
Jean Chevronnet 2026-08-05 16:21:58 +00:00
parent 9b12791774
commit 1581bc15d2
7 changed files with 187 additions and 5 deletions

View file

@ -18,6 +18,7 @@ use crate::Uid;
pub const WATCH_MAX: usize = 128;
pub const MONITOR_MAX: usize = 128;
pub const SILENCE_MAX: usize = 32;
pub const ACCEPT_MAX: usize = 64;
impl Server {
/// A nick just came online (registered, or someone renamed to it): tell its
@ -74,6 +75,15 @@ impl Server {
.count()
}
/// True if `sender_nick` is on `target`'s ACCEPT list (callerid +g).
pub fn is_accepted(&self, target: Uid, sender_nick: &str) -> bool {
let low = sender_nick.to_ascii_lowercase();
self.users
.get(&target)
.map(|u| u.accept.contains(&low))
.unwrap_or(false)
}
/// True if user `by` has silenced someone whose prefix is `sender_mask`.
pub fn is_silenced(&self, by: Uid, sender_mask: &str) -> bool {
self.users