#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>
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 */
}
}
+ IRC_SetPenalty( Client, 1 );
return CONNECTED;
} /* Channel_Mode */
Add_Invite( CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, CHAR *Pattern )
{
CHAR *mask;
+ BOOLEAN already;
assert( Client != NULL );
assert( Channel != NULL );
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 */
Add_Ban( CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, CHAR *Pattern )
{
CHAR *mask;
+ BOOLEAN already;
assert( Client != NULL );
assert( Channel != NULL );
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 */