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

@ -31,6 +31,7 @@ pub enum Event {
MemoDeleted { account: String, index: usize },
MemoIgnoreAdd { account: String, target: String },
MemoIgnoreDel { account: String, target: String },
MemoPrefsSet { account: String, notify: bool, limit: Option<u32> },
NickGrouped { nick: String, account: String },
NickUngrouped { nick: String },
ChannelRegistered { name: String, founder: String, ts: u64 },
@ -160,6 +161,7 @@ impl Event {
| Event::MemoDeleted { .. }
| Event::MemoIgnoreAdd { .. }
| Event::MemoIgnoreDel { .. }
| Event::MemoPrefsSet { .. }
| Event::NickGrouped { .. }
| Event::NickUngrouped { .. }
| Event::AccountSeen { .. }
@ -354,6 +356,12 @@ pub(crate) fn apply(accounts: &mut HashMap<String, Account>, channels: &mut Hash
a.memo_ignore.retain(|t| !t.eq_ignore_ascii_case(&target));
}
}
Event::MemoPrefsSet { account, notify, limit } => {
if let Some(a) = accounts.get_mut(&key(&account)) {
a.memo_notify = notify;
a.memo_limit = limit;
}
}
Event::NickGrouped { nick, account } => {
grouped.insert(key(&nick), account);
}