Commit Diff


commit - d978d8ddbb886456a05932e49a2f59fe49dd9bea
commit + fbec1f1070b35586b7e932ccec88383066faad50
blob - ec8771e979007aad2ae7b5647c1057bb3865a000
blob + cf6354171df7a454dbd704163b0a146e90673729
--- src/ngircd/irc-mode.c
+++ src/ngircd/irc-mode.c
@@ -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.31 2003/01/21 21:04:16 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -509,6 +509,13 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Or
 		/* 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 */