* @return The new ban entry on success, NULL on failure.
*/
static struct Ban *
-apply_silence(struct Client *sptr, const char *mask)
+apply_silence(struct Client *sptr, char *mask)
{
struct Ban *sile;
int flags;
}
/* Make the silence, set flags, and apply it. */
- sile = make_ban(mask);
+ sile = make_ban(pretty_mask(mask));
sile->flags |= flags;
return apply_ban(&cli_user(sptr)->silence, sile, 1) ? NULL : sile;
}
maxlength = maxsiles * feature_int(FEAT_AVBANLEN);
siles = totlength = 0;
/* Count number of current silences and their total length. */
+ plast = &cli_user(sptr)->silence;
for (sile = cli_user(sptr)->silence; sile; sile = sile->next) {
if (sile->flags & (BAN_OVERLAPPED | BAN_ADD | BAN_DEL))
continue;
siles++;
totlength += strlen(sile->banstr);
+ plast = &sile->next;
}
for (ii = jj = 0; ii < ac_count; ++ii) {
sile = accepted[ii];
if (!(sile->flags & (BAN_OVERLAPPED | BAN_DEL))) {
slen = strlen(sile->banstr);
if ((siles >= maxsiles) || (totlength + slen >= maxlength)) {
+ *plast = NULL;
+ if (MyUser(sptr))
+ send_reply(sptr, ERR_SILELISTFULL, accepted[ii]->banstr);
free_ban(accepted[ii]);
continue;
}
/* Update counts. */
siles++;
totlength += slen;
+ plast = &sile->next;
}
/* Store the update. */
accepted[jj++] = sile;