]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/core/m_part.c
Removal of ancient SVN ID's part one
[irc/rqf/shadowircd.git] / modules / core / m_part.c
index 64e9b35d7576991a668b512fad640ef9ae36d700..c69f314e5ff531da3a87871cba8493f1f681a90d 100644 (file)
@@ -21,7 +21,6 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: m_part.c 98 2005-09-11 03:37:47Z nenolod $
  */
 
 #include "stdinc.h"
@@ -58,7 +57,6 @@ static void part_one_client(struct Client *client_p,
 
 /*
 ** m_part
-**      parv[0] = sender prefix
 **      parv[1] = channel
 **      parv[2] = reason
 */
@@ -80,8 +78,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 +100,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)
        {
@@ -125,15 +122,19 @@ part_one_client(struct Client *client_p, struct Client *source_p, char *name, ch
         *  Remove user from the old channel (if any)
         *  only allow /part reasons in -m chans
         */
-       if(reason[0] && (is_chanop(msptr) || !MyConnect(source_p) ||
-                        ((can_send(chptr, source_p, msptr) > 0 &&
+       if(reason[0] && (is_any_op(msptr) || !MyConnect(source_p) ||
+                        ((can_send(chptr, source_p, msptr) > 0 && ConfigFileEntry.use_part_messages &&
                           (source_p->localClient->firsttime +
                            ConfigFileEntry.anti_spam_exit_message_time) < rb_current_time()))))
        {
+               if(chptr->mode.mode & MODE_NOCOLOR && (!ConfigChannel.exempt_cmode_c || !is_any_op(msptr)))
+               {
+                       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_server(client_p, chptr, NOCAPS, CAP_TS6,
-                             ":%s PART %s :%s", source_p->name, chptr->chname, reason);
                sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s PART %s :%s",
                                     source_p->name, source_p->username,
                                     source_p->host, chptr->chname, reason);
@@ -142,8 +143,6 @@ part_one_client(struct Client *client_p, struct Client *source_p, char *name, ch
        {
                sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
                              ":%s PART %s", use_id(source_p), chptr->chname);
-               sendto_server(client_p, chptr, NOCAPS, CAP_TS6,
-                             ":%s PART %s", source_p->name, chptr->chname);
                sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s PART %s",
                                     source_p->name, source_p->username,
                                     source_p->host, chptr->chname);