]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/core/m_part.c
Automated merge with ssh://taros@hg.atheme.org//hg/unofficial/shadowircd
[irc/rqf/shadowircd.git] / modules / core / m_part.c
index b0cd6b08baf4034510b0e69e76b80fbc96eab853..334665b6ed88188ac7ad7c53776ddeb80b3e8fca 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"
@@ -40,6 +39,7 @@
 #include "s_conf.h"
 #include "packet.h"
 #include "inline/stringops.h"
+#include "channel.h"
 
 static int m_part(struct Client *, struct Client *, int, const char **);
 
@@ -55,10 +55,10 @@ DECLARE_MODULE_AV1(part, NULL, NULL, part_clist, NULL, NULL, "$Revision: 98 $");
 static void part_one_client(struct Client *client_p,
                            struct Client *source_p, char *name, char *reason);
 
+struct module_modes ModuleModes;
 
 /*
 ** m_part
-**      parv[0] = sender prefix
 **      parv[1] = channel
 **      parv[2] = reason
 */
@@ -124,12 +124,12 @@ 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)
+               if(chptr->mode.mode & ModuleModes.MODE_NOCOLOR && (!ConfigChannel.exempt_cmode_c || !is_any_op(msptr)))
                {
                        rb_strlcpy(reason2, reason, BUFSIZE);
                        strip_colour(reason2);