+ /* Are there changed modes? */
+ if( the_modes[1] )
+ {
+ /* Clean up mode string */
+ len = strlen( the_modes ) - 1;
+ if(( the_modes[len] == '+' ) || ( the_modes[len] == '-' )) the_modes[len] = '\0';
+
+ /* Clean up argument string if there are none */
+ if( ! the_args[1] ) the_args[0] = '\0';
+
+ if( Client_Type( Client ) == CLIENT_SERVER )
+ {
+ /* Forward mode changes to channel users and other servers */
+ IRC_WriteStrServersPrefix( Client, Origin, "MODE %s %s%s", Channel_Name( Channel ), the_modes, the_args );
+ IRC_WriteStrChannelPrefix( Client, Channel, Origin, FALSE, "MODE %s %s%s", Channel_Name( Channel ), the_modes, the_args );
+ }
+ else
+ {
+ /* Send reply to client and inform other servers and channel users */
+ ok = IRC_WriteStrClientPrefix( Client, Origin, "MODE %s %s%s", Channel_Name( Channel ), the_modes, the_args );
+ IRC_WriteStrServersPrefix( Client, Origin, "MODE %s %s%s", Channel_Name( Channel ), the_modes, the_args );
+ IRC_WriteStrChannelPrefix( Client, Channel, Origin, FALSE, "MODE %s %s%s", Channel_Name( Channel ), the_modes, the_args );
+ }
+ }
+
+ IRC_SetPenalty( Client, 1 );
+ return CONNECTED;
+} /* Channel_Mode */