This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Undernet IRC Server Source Code.".

The branch, u2_10_12_branch has been updated
       via  5cfa0027e5c632d087dad6a3ece271ba7bd7622f (commit)
      from  ae85ca6a216ffe9b636f0edc7946e3bc2477e4b6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5cfa0027e5c632d087dad6a3ece271ba7bd7622f
Author: Michael Poole <[email protected]>
Date:   Mon Mar 27 20:44:49 2017 -0400

    m_part: Block part messages with colors to +c channels.

diff --git a/ircd/m_part.c b/ircd/m_part.c
index bc34ce9..a2c3bd8 100644
--- a/ircd/m_part.c
+++ b/ircd/m_part.c
@@ -107,7 +107,7 @@ int m_part(struct Client* cptr, struct Client* sptr, int 
parc, char* parv[])
   struct Channel *chptr;
   struct Membership *member;
   struct JoinBuf parts;
-  unsigned int flags = 0;
+  int colors = 0;
   char *p = 0;
   char *name;
 
@@ -122,9 +122,20 @@ int m_part(struct Client* cptr, struct Client* sptr, int 
parc, char* parv[])
               (parc > 2 && !EmptyString(parv[parc - 1])) ? parv[parc - 1] : 0,
               0);
 
+  /* check for colors in message */
+  if (parts.jb_comment) {
+    for (p = parts.jb_comment; *p != '\0'; ++p) {
+      if (*p == 3 || *p == 27) {
+        colors = 1;
+        break;
+      }
+    }
+  }
+
   /* scan through channel list */
   for (name = ircd_strtok(&p, parv[1], ","); name;
        name = ircd_strtok(&p, 0, ",")) {
+    unsigned int flags = 0;
 
     chptr = get_channel(sptr, name, CGT_NO_CREATE); /* look up channel */
 
@@ -147,6 +158,9 @@ int m_part(struct Client* cptr, struct Client* sptr, int 
parc, char* parv[])
       parts.jb_comment = 0;
     }
 
+    if ((member->channel->mode.mode & MODE_NOCOLOR) && colors)
+      flags |= CHFL_BANNED;
+
     if (IsDelayedJoin(member))
       flags |= CHFL_DELAYED;
 
-----------------------------------------------------------------------

Summary of changes:
 ircd/m_part.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
Undernet IRC Server Source Code.
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to