Author: Isomer <isomer@coders.net>
[ircu2.10.12-pk.git] / ircd / m_notice.c
index 202297248c8904db994bbb9796503216f14dcb56..8610da35516cbda82ba5783d02e1002f71032552 100644 (file)
@@ -79,6 +79,8 @@
  *            note:   it is guaranteed that parv[0]..parv[parc-1] are all
  *                    non-NULL pointers.
  */
+#include "config.h"
+
 #if 0
 /*
  * No need to include handlers.h here the signatures must match
@@ -118,7 +120,7 @@ int m_notice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   assert(0 != cptr);
   assert(cptr == sptr);
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
   if (parc < 2 || EmptyString(parv[1]))
     return send_reply(sptr, ERR_NORECIPIENT, MSG_NOTICE);
@@ -161,13 +163,13 @@ int ms_notice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   char* name;
   char* server;
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
   if (parc < 3) {
     /*
      * we can't deliver it, sending an error back is pointless
      */
-    return 0;
+    return protocol_violation(sptr,"Not enough params for NOTICE");
   }
   name = parv[1];
   /*
@@ -208,7 +210,7 @@ int mo_notice(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   assert(0 != cptr);
   assert(cptr == sptr);
 
-  sptr->flags &= ~FLAGS_TS8;
+  cli_flags(sptr) &= ~FLAGS_TS8;
 
   if (parc < 2 || EmptyString(parv[1]))
     return send_reply(sptr, ERR_NORECIPIENT, MSG_NOTICE);
@@ -326,7 +328,8 @@ static int m_message(struct Client *cptr, struct Client *sptr,
         acptr = 0;
       if (acptr)
       {
-        if (MyUser(sptr) && check_target_limit(sptr, acptr, acptr->name, 0))
+        if (MyUser(sptr) && !IsChannelService(acptr) && 
+           check_target_limit(sptr, acptr, acptr->name, 0))
           continue;
         if (!is_silenced(sptr, acptr))
         {