Commit Diff


commit - 6b1e322865e9ffadacb2455bd76f3e59aa669501
commit + 967476799f6fa2b30f82cbebb270d055ec63a547
blob - fbeb3cc49a42baf9a1c3cda3f6a14710d3f8f883
blob + 69820d1d28d5da4e725039427d16d68eecf8e199
--- 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.34 2004/04/09 21:41:52 alex Exp $";
+static char UNUSED id[] = "$Id: irc-mode.c,v 1.35 2004/04/25 15:42:05 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -635,6 +635,7 @@ LOCAL BOOLEAN
 Add_Invite( CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, CHAR *Pattern )
 {
 	CHAR *mask;
+	BOOLEAN already;
 
 	assert( Client != NULL );
 	assert( Channel != NULL );
@@ -642,7 +643,11 @@ Add_Invite( CLIENT *Prefix, CLIENT *Client, CHANNEL *C
 
 	mask = Lists_MakeMask( Pattern );
 
+	already = Lists_IsInviteEntry( mask, Channel );
+	
 	if( ! Lists_AddInvited( mask, Channel, FALSE )) return CONNECTED;
+	
+	if(( Client_Type( Prefix ) == CLIENT_SERVER ) && ( already == TRUE )) return CONNECTED;
 
 	return Send_ListChange( "+I", Prefix, Client, Channel, mask );
 } /* Add_Invite */
@@ -652,6 +657,7 @@ LOCAL BOOLEAN
 Add_Ban( CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, CHAR *Pattern )
 {
 	CHAR *mask;
+	BOOLEAN already;
 
 	assert( Client != NULL );
 	assert( Channel != NULL );
@@ -659,8 +665,12 @@ Add_Ban( CLIENT *Prefix, CLIENT *Client, CHANNEL *Chan
 
 	mask = Lists_MakeMask( Pattern );
 
+	already = Lists_IsBanEntry( mask, Channel );
+
 	if( ! Lists_AddBanned( mask, Channel )) return CONNECTED;
 
+	if(( Client_Type( Prefix ) == CLIENT_SERVER ) && ( already == TRUE )) return CONNECTED;
+
 	return Send_ListChange( "+b", Prefix, Client, Channel, mask );
 } /* Add_Ban */