]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-mode.c
Added cast to integer for Solaris.
[ngircd-alex.git] / src / ngircd / irc-mode.c
index cf6354171df7a454dbd704163b0a146e90673729..69820d1d28d5da4e725039427d16d68eecf8e199 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc-mode.c,v 1.31 2003/01/21 21:04:16 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>
@@ -225,12 +225,13 @@ client_exit:
                else
                {
                        /* Send reply to client and inform other servers */
-                       ok = IRC_WriteStrClientPrefix( Client, Origin, "MODE %s %s", Client_ID( Target ), the_modes );
+                       ok = IRC_WriteStrClientPrefix( Client, Origin, "MODE %s :%s", Client_ID( Target ), the_modes );
                        IRC_WriteStrServersPrefix( Client, Origin, "MODE %s :%s", Client_ID( Target ), the_modes );
                }
                Log( LOG_DEBUG, "User \"%s\": Mode change, now \"%s\".", Client_Mask( Target ), Client_Modes( Target ));
        }
-               
+       
+       IRC_SetPenalty( Client, 1 );    
        return ok;
 } /* Client_Mode */
 
@@ -598,6 +599,7 @@ chan_exit:
                }
        }
 
+       IRC_SetPenalty( Client, 1 );
        return CONNECTED;
 } /* Channel_Mode */
 
@@ -633,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 );
@@ -640,7 +643,12 @@ Add_Invite( CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, CHAR *Pattern )
 
        mask = Lists_MakeMask( Pattern );
 
-       if( ! Lists_AddInvited( Prefix, mask, Channel, FALSE )) return CONNECTED;
+       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 */
 
@@ -649,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 );
@@ -656,7 +665,12 @@ Add_Ban( CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, CHAR *Pattern )
 
        mask = Lists_MakeMask( Pattern );
 
-       if( ! Lists_AddBanned( Prefix, mask, Channel )) return CONNECTED;
+       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 */