for (i = 0; i <= HighestFd; i++)
{
struct Client *acptr = 0;
- if ((acptr = LocalClientArray[i]) && con_listing(acptr) &&
- (con_listing(acptr))->chptr == chptr)
+ if ((acptr = LocalClientArray[i]) && cli_listing(acptr) &&
+ (cli_listing(acptr))->chptr == chptr)
{
list_next_channels(acptr, 1);
break; /* Only one client can list a channel */
{
struct Membership* chan;
assert(0 != cptr);
- assert(0 != cptr->user);
+ assert(0 != cli_user(cptr));
while ((chan = (cli_user(cptr))->channel))
remove_user_from_channel(cptr, chan->channel);
/*
* You can't speak if your off channel, if the channel is modeless, or
- * +n.(no external messages)
+ * +n (no external messages) or +m (moderated).
*/
if (!member) {
- if ((chptr->mode.mode & MODE_NOPRIVMSGS) || IsModelessChannel(chptr->chname))
+ if ((chptr->mode.mode & (MODE_NOPRIVMSGS|MODE_MODERATED))
+ || IsModelessChannel(chptr->chname))
return 0;
else
return 1;
if (lp->value.chptr == chptr)
return 0;
-#ifdef OPER_WALK_THROUGH_LMODES
/* An oper can force a join on a local channel using "OVERRIDE" as the key.
a HACK(4) notice will be sent if he would not have been supposed
to join normally. */
- if (IsOperOnLocalChannel(sptr,chptr->chname) && !BadPtr(key) && compall("OVERRIDE",key) == 0)
- {
+ if (IsLocalChannel(chptr->chname) && HasPriv(sptr, PRIV_WALK_LCHAN) &&
+ !BadPtr(key) && compall("OVERRIDE",key) == 0)
overrideJoin = MAGIC_OPER_OVERRIDE;
- }
-#endif
if (chptr->mode.mode & MODE_INVITEONLY)
return overrideJoin + ERR_INVITEONLYCHAN;
/* List and skip all channels that are listen */
void list_next_channels(struct Client *cptr, int nr)
{
- struct ListingArgs *args = con_listing(cptr);
+ struct ListingArgs *args = cli_listing(cptr);
struct Channel *chptr = args->chptr;
chptr->mode.mode &= ~MODE_LISTED;
while (is_listed(chptr) || --nr >= 0)
}
if (!chptr)
{
- MyFree(con_listing(cptr));
- con_listing(cptr) = NULL;
+ MyFree(cli_listing(cptr));
+ cli_listing(cptr) = NULL;
send_reply(cptr, RPL_LISTEND);
break;
}
}
if (chptr)
{
- (con_listing(cptr))->chptr = chptr;
+ (cli_listing(cptr))->chptr = chptr;
chptr->mode.mode |= MODE_LISTED;
}
}
newban->next = 0;
DupString(newban->value.ban.banstr, t_str);
- newban->value.ban.who = state->sptr->name;
+ newban->value.ban.who = cli_name(state->sptr);
newban->value.ban.when = TStime();
newban->flags = CHFL_BAN | MODE_ADD;
}
}
-#ifdef NO_OPER_DEOP_LCHAN
/* don't allow local opers to be deopped on local channels */
if (MyUser(state->sptr) && state->cli_change[i].client != state->sptr &&
- IsOperOnLocalChannel(state->cli_change[i].client,
- state->chptr->chname)) {
+ IsLocalChannel(state->chptr->chname) &&
+ HasPriv(state->cli_change[i].client, PRIV_DEOP_LCHAN)) {
send_reply(state->sptr, ERR_ISOPERLCHAN,
cli_name(state->cli_change[i].client),
state->chptr->chname);
continue;
}
-#endif
}
/* accumulate the change */