]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/core/m_message.c
Automated merge with ssh://taros@hg.atheme.org//hg/unofficial/shadowircd
[irc/rqf/shadowircd.git] / modules / core / m_message.c
index dd41852d35126f870124abeb35e3d1b0d47e343a..46ba4e9ffb547a67d24eb2e8b8324b027832e9d0 100644 (file)
@@ -536,6 +536,14 @@ msg_channel(int p_or_n, const char *command,
        /* chanops and voiced can flood their own channel with impunity */
        if((result = can_send(chptr, source_p, NULL)))
        {
+               if(result != CAN_SEND_OPV && MyClient(source_p) &&
+                  !IsOper(source_p) &&
+                  !add_channel_target(source_p, chptr))
+               {
+                       sendto_one(source_p, form_str(ERR_TARGCHANGE),
+                                  me.name, source_p->name, chptr->chname);
+                       return;
+               }
                if(result == CAN_SEND_OPV ||
                   !flood_attack_channel(p_or_n, source_p, chptr, chptr->chname))
                {
@@ -586,6 +594,13 @@ msg_channel(int p_or_n, const char *command,
                        (!(chptr->mode.mode & MODE_NOPRIVMSGS) ||
                         IsMember(source_p, chptr)))
        {
+               if(MyClient(source_p) && !IsOper(source_p) &&
+                  !add_channel_target(source_p, chptr))
+               {
+                       sendto_one(source_p, form_str(ERR_TARGCHANGE),
+                                  me.name, source_p->name, chptr->chname);
+                       return;
+               }
                if(!flood_attack_channel(p_or_n, source_p, chptr, chptr->chname))
                {
                        sendto_channel_opmod(client_p, source_p, chptr,
@@ -747,8 +762,8 @@ msg_client(int p_or_n, const char *command,
                 */
                if(p_or_n != NOTICE && MyClient(source_p) &&
                                IsSetCallerId(source_p) &&
-                               !accept_message(target_p, source_p) &&
-                               !IsOper(target_p))
+                               IsSetSCallerId(source_p) &&
+                               !accept_message(target_p, source_p))
                {
                        if(rb_dlink_list_length(&source_p->localClient->allow_list) <
                                        ConfigFileEntry.max_accept)