]> jfr.im git - irc/rqf/shadowircd.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)
modules/core/m_mode.c
src/chmode.c
src/s_serv.c

index 5549203f880dbbe55991db740673066cfc412731..e00eff2a08b2472fdaece035fa01bf2837d6bc8f 100644 (file)
@@ -59,7 +59,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 042fbeacf6bb83f467f3575063bb06ec2df0fce9..a676d0ae495f6c453d3c901c64a7fdf6a3b6413a 100644 (file)
@@ -2246,8 +2246,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 65e8e0f1ab4a98cafc9006cae2fec8e1261acf4f..5f272b005ee69e35413a58fb5c196d3db8f754b6 100644 (file)
@@ -679,9 +679,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);