]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-mode.c
Removed "USE_" prefixes of configuration #defines.
[ngircd-alex.git] / src / ngircd / irc-mode.c
index ec8771e979007aad2ae7b5647c1057bb3865a000..5586989ca75e8cca7895c2252effbf86bf3c0610 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc-mode.c,v 1.30 2003/01/17 19:04:19 alex Exp $";
+static char UNUSED id[] = "$Id: irc-mode.c,v 1.32 2003/11/05 23:24:48 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -230,7 +230,8 @@ client_exit:
                }
                Log( LOG_DEBUG, "User \"%s\": Mode change, now \"%s\".", Client_Mask( Target ), Client_Modes( Target ));
        }
-               
+       
+       IRC_SetPenalty( Client, 1 );    
        return ok;
 } /* Client_Mode */
 
@@ -509,6 +510,13 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel )
                /* Is there a valid mode change? */
                if( ! x[0] ) continue;
 
+               /* Validate target client */
+               if( client && ( ! Channel_IsMemberOf( Channel, client )))
+               {
+                       if( ! IRC_WriteStrClient( Origin, ERR_USERNOTINCHANNEL_MSG, Client_ID( Origin ), Client_ID( client ), Channel_Name( Channel ))) break;
+                       continue;
+               }
+
                if( set )
                {
                        /* Set mode */
@@ -591,6 +599,7 @@ chan_exit:
                }
        }
 
+       IRC_SetPenalty( Client, 1 );
        return CONNECTED;
 } /* Channel_Mode */