callerid: cap the auto-accept list like the explicit ACCEPT command
This commit is contained in:
parent
fad66eaac2
commit
e28efb03e6
1 changed files with 2 additions and 1 deletions
|
|
@ -648,8 +648,9 @@ pub(crate) fn deliver(s: &mut Server, uid: Uid, params: &[String], notice: bool)
|
|||
.get(&tuid)
|
||||
.map(|u| u.nick.to_ascii_lowercase())
|
||||
.unwrap_or_default();
|
||||
let maxacc = s.conf_num("maxaccept", crate::watch::ACCEPT_MAX);
|
||||
if let Some(su) = s.users.get_mut(&uid) {
|
||||
if !tnick.is_empty() && !su.accept.contains(&tnick) {
|
||||
if !tnick.is_empty() && su.accept.len() < maxacc && !su.accept.contains(&tnick) {
|
||||
su.accept.push(tnick);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue