extern void set_channel_mode(struct Client *client_p, struct Client *source_p,
struct Channel *chptr, struct membership *msptr, int parc, const char *parv[]);
extern void set_channel_mlock(struct Client *client_p, struct Client *source_p,
- struct Channel *chptr, const char *newmlock);
+ struct Channel *chptr, const char *newmlock, int propagate);
extern struct ChannelMode chmode_table[256];
/* If this mode char is locked, don't allow local users to change it. */
if (MyClient(source_p) && chptr->mode_lock && strchr(chptr->mode_lock, c))
{
- sendto_one_numeric(source_p, ERR_MLOCKRESTRICTED, form_str(ERR_MLOCKRESTRICTED), chptr->name, c, chptr->mode_lock);
+ sendto_one_numeric(source_p, ERR_MLOCKRESTRICTED, form_str(ERR_MLOCKRESTRICTED), chptr->chname, c, chptr->mode_lock);
continue;
}
chmode_table[(unsigned char) c].set_func(fakesource_p, chptr, alevel,
*/
void
set_channel_mlock(struct Client *client_p, struct Client *source_p,
- struct Channel *chptr, const char *newmlock)
+ struct Channel *chptr, const char *newmlock, int propagate)
{
rb_free(chptr->mode_lock);
chptr->mode_lock = newmlock ? rb_strdup(newmlock) : NULL;
- sendto_server(client_p, NULL, CAP_TS6 | CAP_MLOCK, NOCAPS, ":%s MLOCK %ld %s :%s",
- source_p->id, (long) chptr->channelts, chptr->chname,
- chptr->mode_lock ? chptr->mode_lock : "");
+ if (propagate)
+ {
+ sendto_server(client_p, NULL, CAP_TS6 | CAP_MLOCK, NOCAPS, ":%s MLOCK %ld %s :%s",
+ source_p->id, (long) chptr->channelts, chptr->chname,
+ chptr->mode_lock ? chptr->mode_lock : "");
+ }
}