Enforce TS rules on MLOCKs.
This commit is contained in:
parent
e610316019
commit
fc579e36e7
|
@ -293,7 +293,7 @@ void resv_chan_forcepart(const char *name, const char *reason, int temp_time);
|
|||
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];
|
||||
|
||||
|
|
|
@ -236,7 +236,7 @@ ms_mlock(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
return 0;
|
||||
|
||||
if(IsServer(source_p))
|
||||
set_channel_mlock(client_p, source_p, chptr, parv[3]);
|
||||
set_channel_mlock(client_p, source_p, chptr, parv[3], TRUE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2087,7 +2087,7 @@ set_channel_mode(struct Client *client_p, struct Client *source_p,
|
|||
/* 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,
|
||||
|
@ -2246,12 +2246,15 @@ set_channel_mode(struct Client *client_p, struct Client *source_p,
|
|||
*/
|
||||
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;
|
||||
|
||||
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 : "");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue