]> jfr.im git - irc/freenode/ircd-seven.git/commitdiff
Allow the final parameter of MLOCK to be empty, to remove an existing mlock
authorStephen Bennett <redacted>
Sun, 2 May 2010 19:42:46 +0000 (20:42 +0100)
committerStephen Bennett <redacted>
Sun, 2 May 2010 19:42:46 +0000 (20:42 +0100)
include/channel.h
modules/core/m_mode.c
src/chmode.c
src/s_serv.c

index b7a80f4f007d344432d48eafccd7de228f26deeb..01b7275c50e25d011326bffb30f6cdae0d37c24f 100644 (file)
@@ -241,7 +241,6 @@ extern void del_invite(struct Channel *chptr, struct Client *who);
 
 const char *channel_modes_real(struct Channel *chptr, struct Mode *mode, struct Client *who);
 #define channel_modes(chptr, who)      channel_modes_real(chptr, &(chptr)->mode, who)
-#define channel_mlock(chptr, who)      channel_modes_real(chptr, &(chptr)->mode_lock, who)
 
 extern struct Channel *find_bannickchange_channel(struct Client *client_p);
 
index 4be9ab12b62711f462f85a86e3af9a9d5bc2a14b..ac0208010e895d758a86d7cf9d1ab9d76665d943 100644 (file)
@@ -58,7 +58,7 @@ struct Message tmode_msgtab = {
 };
 struct Message mlock_msgtab = {
        "MLOCK", 0, 0, 0, MFLG_SLOW,
-       {mg_ignore, mg_ignore, {ms_mlock, 4}, {ms_mlock, 4}, mg_ignore, mg_ignore}
+       {mg_ignore, mg_ignore, {ms_mlock, 3}, {ms_mlock, 3}, mg_ignore, mg_ignore}
 };
 struct Message bmask_msgtab = {
        "BMASK", 0, 0, 0, MFLG_SLOW,
index b345b8e1d1d2d5d6233bc1347607c8af3fcb5f3f..38393b2a9d1d77df89d9712eac987b38da951b23 100644 (file)
@@ -1774,8 +1774,9 @@ set_channel_mlock(struct Client *client_p, struct Client *source_p,
                  struct Channel *chptr, const char *newmlock)
 {
        rb_free(chptr->mode_lock);
-       chptr->mode_lock = rb_strdup(newmlock);
+       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);
+       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 : "");
 }
index 684e3a1696d911ff17d81acd6242d0b4d7ab8bde..3b4778b6be893dba96559eaad4a4afa620dd326b 100644 (file)
@@ -659,9 +659,9 @@ burst_TS6(struct Client *client_p)
                                   chptr->topic);
 
                if(IsCapable(client_p, CAP_MLOCK))
-                       sendto_one(client_p, ":%s MLOCK %ld %s %s",
+                       sendto_one(client_p, ":%s MLOCK %ld %s :%s",
                                   me.id, (long) chptr->channelts, chptr->chname,
-                                  channel_mlock(chptr, client_p));
+                                  EmptyString(chptr->mode_lock) ? "" : chptr->mode_lock);
 
                hchaninfo.chptr = chptr;
                call_hook(h_burst_channel, &hchaninfo);