]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/chmode.c
Allow the final parameter of MLOCK to be empty, to remove an existing mlock
[irc/rqf/shadowircd.git] / src / chmode.c
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 : "");
 }