*/
if(MyClient(source_p))
{
- if((rb_dlink_list_length(&chptr->banlist) + rb_dlink_list_length(&chptr->exceptlist) + rb_dlink_list_length(&chptr->invexlist) + rb_dlink_list_length(&chptr->quietlist)) >= (unsigned long)(chptr->mode.mode & MODE_EXLIMIT ? ConfigChannel.max_bans_large : ConfigChannel.max_bans))
+ if((rb_dlink_list_length(&chptr->banlist) + rb_dlink_list_length(&chptr->exceptlist) + rb_dlink_list_length(&chptr->invexlist) + rb_dlink_list_length(&chptr->quietlist)) >= (unsigned long)((chptr->mode.mode & MODE_EXLIMIT) ? ConfigChannel.max_bans_large : ConfigChannel.max_bans))
{
sendto_one(source_p, form_str(ERR_BANLISTFULL),
me.name, source_p->name, chptr->chname, realban);
/* invalidate the can_send() cache */
if(mode_type == CHFL_BAN || mode_type == CHFL_QUIET || mode_type == CHFL_EXCEPTION)
- chptr->bants++;
+ chptr->bants = rb_current_time();
return true;
}
/* invalidate the can_send() cache */
if(mode_type == CHFL_BAN || mode_type == CHFL_QUIET || mode_type == CHFL_EXCEPTION)
- chptr->bants++;
+ chptr->bants = rb_current_time();
return banptr;
}
check_forward(struct Client *source_p, struct Channel *chptr,
const char *forward)
{
- struct Channel *targptr;
+ struct Channel *targptr = NULL;
struct membership *msptr;
if(!check_channel_name(forward) ||
int alevel, int parc, int *parn,
const char **parv, int *errors, int dir, char c, long mode_type)
{
- if(!IsOper(source_p) && !IsServer(source_p))
+ if(!IsOperGeneral(source_p) && !IsServer(source_p))
{
if(!(*errors & SM_ERR_NOPRIVS))
sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
*errors |= SM_ERR_NOPRIVS;
return;
}
- if(MyClient(source_p) && !IsOperResv(source_p))
+ if(MyClient(source_p) && !HasPrivilege(source_p, "oper:cmodes"))
{
if(!(*errors & SM_ERR_NOPRIVS))
sendto_one(source_p, form_str(ERR_NOPRIVS), me.name,
- source_p->name, "resv");
+ source_p->name, "cmodes");
*errors |= SM_ERR_NOPRIVS;
return;
}
- if(!allow_mode_change(source_p, chptr, CHFL_CHANOP, errors, c))
- return;
-
if(MyClient(source_p) && (++mode_limit_simple > MAXMODES_SIMPLE))
return;
default:
sendto_realops_snomask(SNO_GENERAL, L_ALL, "chm_ban() called with unknown type!");
return;
- break;
}
if(dir == 0 || parc <= *parn)
if(!allow_mode_change(source_p, chptr, alevel, errors, c))
return;
#else
- if(!IsOper(source_p) && !IsServer(source_p))
+ if(!IsOperGeneral(source_p) && !IsServer(source_p))
{
if(!(*errors & SM_ERR_NOPRIVS))
sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
*mbuf = '\0';
if(cur_len > mlen)
- sendto_channel_local(flags, chptr, "%s %s", modebuf,
- parabuf);
+ sendto_channel_local(IsServer(source_p) ? fakesource_p : source_p,
+ flags, chptr, "%s %s", modebuf, parabuf);
else
continue;
*mbuf = '\0';
if(cur_len > mlen)
- sendto_channel_local(flags, chptr, "%s %s", modebuf, parabuf);
+ sendto_channel_local(IsServer(source_p) ? fakesource_p : source_p,
+ flags, chptr, "%s %s", modebuf, parabuf);
}
/* only propagate modes originating locally, or if we're hubbing */