MemoServ: add SET NOTIFY and SET LIMIT
All checks were successful
CI / check (push) Successful in 3m35s

SET NOTIFY {ON|OFF} controls whether you're told about new memos on login;
SET LIMIT <n>|NONE sets your mailbox cap (honoured on SEND, NONE = the
network default). New memo_notify/memo_limit account fields + one
MemoPrefsSet event.
This commit is contained in:
Jean Chevronnet 2026-07-16 00:29:33 +00:00
parent 125b8c7701
commit 2c282d036f
No known key found for this signature in database
14 changed files with 152 additions and 8 deletions

View file

@ -14,7 +14,8 @@ pub fn handle(me: &str, from: &Sender, account: &str, args: &[&str], ctx: &mut S
ctx.notice(me, from.uid, format!("\x02{target}\x02 isn't registered."));
return;
};
if db.memo_list(&dest).len() >= MAX_MEMOS {
let limit = db.memo_limit_of(&dest).unwrap_or(MAX_MEMOS as u32) as usize;
if db.memo_list(&dest).len() >= limit {
ctx.notice(me, from.uid, format!("\x02{target}\x02's mailbox is full — they'll need to clear some memos first."));
return;
}