]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Allow coloured part reasons in -c channels.
authorJilles Tjoelker <redacted>
Sat, 29 Nov 2008 21:22:18 +0000 (22:22 +0100)
committerJilles Tjoelker <redacted>
Sat, 29 Nov 2008 21:22:18 +0000 (22:22 +0100)
modules/core/m_part.c

index d6ed969acaf9e1f860242c1c783de1acba73132a..b0cd6b08baf4034510b0e69e76b80fbc96eab853 100644 (file)
@@ -80,8 +80,6 @@ m_part(struct Client *client_p, struct Client *source_p, int parc, const char *p
        if(MyClient(source_p) && !IsFloodDone(source_p))
                flood_endgrace(source_p);
 
-       strip_colour(reason);
-
        while(name)
        {
                part_one_client(client_p, source_p, name, reason);
@@ -104,6 +102,7 @@ part_one_client(struct Client *client_p, struct Client *source_p, char *name, ch
 {
        struct Channel *chptr;
        struct membership *msptr;
+       char reason2[BUFSIZE];
 
        if((chptr = find_channel(name)) == NULL)
        {
@@ -130,6 +129,12 @@ part_one_client(struct Client *client_p, struct Client *source_p, char *name, ch
                           (source_p->localClient->firsttime +
                            ConfigFileEntry.anti_spam_exit_message_time) < rb_current_time()))))
        {
+               if(chptr->mode.mode & MODE_NOCOLOR)
+               {
+                       rb_strlcpy(reason2, reason, BUFSIZE);
+                       strip_colour(reason2);
+                       reason = reason2;
+               }
                sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
                              ":%s PART %s :%s", use_id(source_p), chptr->chname, reason);
                sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s PART %s :%s",