/*
- * charybdis: A slightly useful ircd.
+ * Solanum: a slightly advanced ircd
* chmode.c: channel mode management
*
* Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
int alevel, int parc, int *parn,
const char **parv, int *errors, int dir, char c, long mode_type)
{
- if(!IsOperGeneral(source_p) && !IsServer(source_p))
+ if(MyClient(source_p) && !IsOperGeneral(source_p))
{
if(!(*errors & SM_ERR_NOPRIVS))
sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
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(MyClient(source_p) && !IsOper(source_p))
{
if(!(*errors & SM_ERR_NOPRIVS))
sendto_one_numeric(source_p, ERR_NOPRIVILEGES, form_str(ERR_NOPRIVILEGES));
for(j = 0; j < 3; j++)
{
- flags = flags_list[j];
+ int send_flags = flags = flags_list[j];
+ const char *priv = NULL;
+ if (flags == ONLY_OPERS)
+ {
+ send_flags = ALL_MEMBERS;
+ priv = "auspex:cmodes";
+ }
cur_len = mlen;
mbuf = modebuf + mlen;
pbuf = parabuf;
*mbuf = '\0';
if(cur_len > mlen)
- sendto_channel_local(IsServer(source_p) ? fakesource_p : source_p,
- flags, chptr, "%s %s", modebuf, parabuf);
+ sendto_channel_local_priv(IsServer(source_p) ? fakesource_p : source_p,
+ send_flags, priv, chptr, "%s %s", modebuf, parabuf);
else
continue;
*mbuf = '\0';
if(cur_len > mlen)
- sendto_channel_local(IsServer(source_p) ? fakesource_p : source_p,
- flags, chptr, "%s %s", modebuf, parabuf);
+ sendto_channel_local_priv(IsServer(source_p) ? fakesource_p : source_p,
+ send_flags, priv, chptr, "%s %s", modebuf, parabuf);
}
/* only propagate modes originating locally, or if we're hubbing */