Commit Diff


commit - d645ce86e9440a891b80bfd2907617e16aa799e8
commit + 7d30c8cebccf1b0e391333858a9d011d1f0d864e
blob - 43b07e0f95c3fbaede51e80b2da087280abf4a48
blob + e35878f286f7fabc2956d123a76ea81a5cb4ceaa
--- src/ngircd/channel.c
+++ src/ngircd/channel.c
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: channel.c,v 1.29 2002/08/26 23:39:22 alex Exp $
+ * $Id: channel.c,v 1.30 2002/08/26 23:47:58 alex Exp $
  *
  * channel.c: Management der Channels
  */
@@ -454,7 +454,6 @@ Channel_ModeDel( CHANNEL *Chan, CHAR Mode )
 	CHAR x[2], *p;
 
 	assert( Chan != NULL );
-	assert( Mode > ' ' );
 
 	x[0] = Mode; x[1] = '\0';
 
@@ -483,7 +482,6 @@ Channel_UserModeAdd( CHANNEL *Chan, CLIENT *Client, CH
 
 	assert( Chan != NULL );
 	assert( Client != NULL );
-	assert( Mode > ' ' );
 
 	cl2chan = Get_Cl2Chan( Chan, Client );
 	assert( cl2chan != NULL );
blob - 73703e577862d7d99e995133367d57068e23fec9
blob + 84e40b457ec3afcf995f2cc92feeeaab12452113
--- src/ngircd/irc-mode.c
+++ src/ngircd/irc-mode.c
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: irc-mode.c,v 1.8 2002/08/26 23:39:22 alex Exp $
+ * $Id: irc-mode.c,v 1.9 2002/08/26 23:47:58 alex Exp $
  *
  * irc-mode.c: IRC-Befehle zur Mode-Aenderung (MODE, AWAY, ...)
  */
@@ -26,7 +26,6 @@
 #include "channel.h"
 #include "defines.h"
 #include "irc-write.h"
-#include "lists.h"
 #include "log.h"
 #include "parse.h"
 #include "messages.h"
@@ -35,16 +34,6 @@
 #include "irc-mode.h"
 
 
-LOCAL BOOLEAN Show_InviteList PARAMS(( CLIENT *Client, CHANNEL *Channel ));
-LOCAL BOOLEAN Show_BanList PARAMS(( CLIENT *Client, CHANNEL *Channel ));
-
-LOCAL BOOLEAN Add_Invite PARAMS(( CLIENT *Client, CHANNEL *Channel, CHAR *Pattern ));
-LOCAL BOOLEAN Add_Ban PARAMS(( CLIENT *Client, CHANNEL *Channel, CHAR *Pattern ));
-
-LOCAL BOOLEAN Del_Invite PARAMS(( CLIENT *Client, CHANNEL *Channel, CHAR *Pattern ));
-LOCAL BOOLEAN Del_Ban PARAMS(( CLIENT *Client, CHANNEL *Channel, CHAR *Pattern ));
-
-
 GLOBAL BOOLEAN
 IRC_MODE( CLIENT *Client, REQUEST *Req )
 {
@@ -77,43 +66,6 @@ IRC_MODE( CLIENT *Client, REQUEST *Req )
 	/* Falsche Anzahl Parameter? */
 	if(( cl ) && ( Req->argc > 2 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
 	if(( chan ) && ( Req->argc > 3 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
-
-	/* Prefix fuer Antworten etc. ermitteln */
-	if( Client_Type( Client ) == CLIENT_SERVER )
-	{
-		prefix = Client_Search( Req->prefix );
-		if( ! prefix ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
-	}
-	else prefix = Client;
-	
-	if(( chan ) && (( Req->argc == 2 ) || ( Req->argc == 3 )))
-	{
-		/* pruefen, ob "Listen-Operation": Invite, Ban */
-		if(( Req->argv[1][0] == '-'  ) || ( Req->argv[1][0] == '+' )) mode_ptr = &Req->argv[1][1];
-		else mode_ptr = &Req->argv[1][0];
-
-		if( Req->argc == 2 )
-		{
-			/* Liste anzeigen */
-			if( *mode_ptr == 'I' ) return Show_InviteList( prefix, chan );
-			if( *mode_ptr == 'b' ) return Show_BanList( prefix, chan );
-		}
-		else
-		{
-			if( Req->argv[1][0] == '+' )
-			{
-				/* Listen-Eintrag hinzufuegen */
-				if( *mode_ptr == 'I' ) return Add_Invite( prefix, chan, Req->argv[2] );
-				if( *mode_ptr == 'b' ) return Add_Ban( prefix, chan, Req->argv[2] );
-			}
-			else if( Req->argv[1][0] == '-' )
-			{
-				/* Listen-Eintrag loeschen */
-				if( *mode_ptr == 'I' ) return Del_Invite( prefix, chan, Req->argv[2] );
-				if( *mode_ptr == 'b' ) return Del_Ban( prefix, chan, Req->argv[2] );
-			}
-		}
-	}
 
 	/* Client ermitteln, wenn bei Channel-Modes mit 3 Parametern */
 	if(( chan ) && (Req->argc == 3 ))
@@ -156,6 +108,14 @@ IRC_MODE( CLIENT *Client, REQUEST *Req )
 		else set = TRUE;
 		if(( *mode_ptr == '-' ) || ( *mode_ptr == '+' )) mode_ptr++;
 	}
+	
+	/* Prefix fuer Antworten etc. ermitteln */
+	if( Client_Type( Client ) == CLIENT_SERVER )
+	{
+		prefix = Client_Search( Req->prefix );
+		if( ! prefix ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
+	}
+	else prefix = Client;
 
 	/* Reply-String mit Aenderungen vorbereiten */
 	if( set ) strcpy( the_modes, "+" );
@@ -427,79 +387,4 @@ IRC_AWAY( CLIENT *Client, REQUEST *Req )
 } /* IRC_AWAY */
 
 
-LOCAL BOOLEAN
-Show_InviteList( CLIENT *Client, CHANNEL *Channel )
-{
-	assert( Client != NULL );
-	assert( Channel != NULL );
-
-	return IRC_WriteStrClient( Client, RPL_ENDOFINVITELIST_MSG, Client_ID( Client ), Channel_Name( Channel ));
-} /* Show_InviteList */
-
-
-LOCAL BOOLEAN
-Show_BanList( CLIENT *Client, CHANNEL *Channel )
-{
-	assert( Client != NULL );
-	assert( Channel != NULL );
-	
-	return IRC_WriteStrClient( Client, RPL_ENDOFBANLIST_MSG, Client_ID( Client ), Channel_Name( Channel ));
-} /* Show_BanList */
-
-
-LOCAL BOOLEAN
-Add_Invite( CLIENT *Client, CHANNEL *Channel, CHAR *Pattern )
-{
-	CHAR *mask;
-
-	assert( Client != NULL );
-	assert( Channel != NULL );
-	assert( Pattern != NULL );
-
-	mask = Lists_MakeMask( Pattern );
-
-	if( ! Lists_AddInvited( mask, Channel, FALSE )) return CONNECTED;
-
-	IRC_WriteStrChannelPrefix( Client, Channel, Client, TRUE, "MODE %s +I %s", Channel_Name( Channel ), mask );
-	if( Client_Type( Client ) == CLIENT_USER )
-	{
-		if( ! IRC_WriteStrClientPrefix( Client, Client, "MODE %s +I %s", Channel_Name( Channel ), mask )) return DISCONNECTED;
-	}
-	return CONNECTED;
-} /* Add_Invite */
-
-
-LOCAL BOOLEAN
-Add_Ban( CLIENT *Client, CHANNEL *Channel, CHAR *Pattern )
-{
-	assert( Client != NULL );
-	assert( Channel != NULL );
-	assert( Pattern != NULL );
-
-	return CONNECTED;
-} /* Add_Ban */
-
-
-LOCAL BOOLEAN
-Del_Invite( CLIENT *Client, CHANNEL *Channel, CHAR *Pattern )
-{
-	assert( Client != NULL );
-	assert( Channel != NULL );
-	assert( Pattern != NULL );
-
-	return CONNECTED;
-} /* Del_Invite */
-
-
-LOCAL BOOLEAN
-Del_Ban( CLIENT *Client, CHANNEL *Channel, CHAR *Pattern )
-{
-	assert( Client != NULL );
-	assert( Channel != NULL );
-	assert( Pattern != NULL );
-
-	return CONNECTED;
-} /* Del_Ban */
-
-
 /* -eof- */
blob - ea64958aea93e734ce083b3b3f6a57e4e6563f88
blob + 7a4f7abe41b8210caf7dae4c86f5e64b1b4ea21c
--- src/ngircd/irc-oper.c
+++ src/ngircd/irc-oper.c
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: irc-oper.c,v 1.6 2002/08/26 23:39:22 alex Exp $
+ * $Id: irc-oper.c,v 1.7 2002/08/26 23:47:58 alex Exp $
  *
  * irc-oper.c: IRC-Operator-Befehle
  */
@@ -120,25 +120,4 @@ IRC_RESTART( CLIENT *Client, REQUEST *Req )
 } /* IRC_RESTART */
 
 
-GLOBAL BOOLEAN
-IRC_CONNECT(CLIENT *Client, REQUEST *Req )
-{
-	/* Vorlaeufige Version zu Debug-Zwecken ... */
-
-	assert( Client != NULL );
-	assert( Req != NULL );
-
-	if( Client_Type( Client ) != CLIENT_USER ) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client ));
-
-	/* Falsche Anzahl Parameter? */
-	if( Req->argc != 0 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
-
-	if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
-
-	Log( LOG_NOTICE|LOG_snotice, "Got CONNECT command from \"%s\".", Client_Mask( Client ));
-	NGIRCd_Passive = FALSE;
-	return CONNECTED;
-} /* IRC_CONNECT */
-
-
 /* -eof- */
blob - 088cf089f6b9d9ac9b6d5386b45be2c0c9fe41e5
blob + fe3e6c36e7cc71fc043c33ca99aa4aec67652cab
--- src/ngircd/irc-oper.h
+++ src/ngircd/irc-oper.h
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: irc-oper.h,v 1.4 2002/08/26 23:39:22 alex Exp $
+ * $Id: irc-oper.h,v 1.5 2002/08/26 23:47:58 alex Exp $
  *
  * irc-oper.h: IRC-Operator-Befehle (Header)
  */
@@ -22,7 +22,6 @@
 GLOBAL BOOLEAN IRC_OPER PARAMS((CLIENT *Client, REQUEST *Req ));
 GLOBAL BOOLEAN IRC_DIE PARAMS((CLIENT *Client, REQUEST *Req ));
 GLOBAL BOOLEAN IRC_RESTART PARAMS((CLIENT *Client, REQUEST *Req ));
-GLOBAL BOOLEAN IRC_CONNECT PARAMS((CLIENT *Client, REQUEST *Req ));
 
 
 #endif
blob - 12de0815c3d48eb60f5629d303924ce458135d3c
blob + aafafe688c8c54275703ba15aed92b943bc957e7
--- src/ngircd/irc-server.c
+++ src/ngircd/irc-server.c
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: irc-server.c,v 1.13 2002/08/26 23:39:22 alex Exp $
+ * $Id: irc-server.c,v 1.14 2002/08/26 23:47:58 alex Exp $
  *
  * irc-server.c: IRC-Befehle fuer Server-Links
  */
@@ -299,7 +299,7 @@ IRC_NJOIN( CLIENT *Client, REQUEST *Req )
 				IRC_WriteStrChannelPrefix( Client, chan, Client, FALSE, "MODE %s +%s %s", channame, modes, Client_ID( c ));
 			}
 		}
-		else Log( LOG_ERR, "Got NJOIN for unknown nick \"%s\", channel \"%s\"!", ptr, channame );
+		else Log( LOG_ERR, "Got NJOIN for unknown nick \"%s\" for channel \"%s\"!", ptr, channame );
 		
 		/* naechsten Nick suchen */
 		ptr = strtok( NULL, "," );
blob - 21355f3d2a7bff3f9b41c25d800a11283c8ec0dd
blob + 0f27cab36013a1fcc3f260ee6c0fd7bb2e1c75cd
--- src/ngircd/lists.c
+++ src/ngircd/lists.c
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: lists.c,v 1.5 2002/08/26 23:39:22 alex Exp $
+ * $Id: lists.c,v 1.6 2002/08/26 23:47:58 alex Exp $
  *
  * lists.c: Verwaltung der "IRC-Listen": Ban, Invite, ...
  */
@@ -25,7 +25,6 @@
 #include "client.h"
 #include "channel.h"
 #include "log.h"
-#include "match.h"
 
 #include <stdlib.h>
 #include <string.h>
@@ -103,8 +102,7 @@ Lists_CheckInvited( CLIENT *Client, CHANNEL *Chan )
 		if( c2c->channel == Chan )
 		{
 			/* Ok, richtiger Channel. Passt die Maske? */
-Log( LOG_DEBUG, "%s : %s", Client_Mask( Client ), c2c->mask );
-			if( Match( Client_Mask( Client ), c2c->mask ))
+			if( strcasecmp( Client_Mask( Client ), c2c->mask ) == 0 )
 			{
 				/* Treffer! */
 				if( c2c->onlyonce )
@@ -126,14 +124,14 @@ Log( LOG_DEBUG, "%s : %s", Client_Mask( Client ), c2c-
 
 
 GLOBAL BOOLEAN
-Lists_AddInvited( CHAR *Mask, CHANNEL *Chan, BOOLEAN OnlyOnce )
+Lists_AddInvited( CHAR *Pattern, CHANNEL *Chan, BOOLEAN OnlyOnce )
 {
 	C2C *c2c;
 
-	assert( Mask != NULL );
+	assert( Pattern != NULL );
 	assert( Chan != NULL );
 
-	c2c = New_C2C( Mask, Chan, OnlyOnce );
+	c2c = New_C2C( Pattern, Chan, OnlyOnce );
 	if( ! c2c )
 	{
 		Log( LOG_ERR, "Can't add new invite list entry!" );
@@ -144,7 +142,7 @@ Lists_AddInvited( CHAR *Mask, CHANNEL *Chan, BOOLEAN O
 	c2c->next = My_Invites;
 	My_Invites = c2c;
 
-	Log( LOG_DEBUG, "Added \"%s\" to invite list for \"%s\".", Mask, Channel_Name( Chan ));
+	Log( LOG_DEBUG, "Added \"%s\" to invite list for \"%s\".", Pattern, Channel_Name( Chan ));
 	return TRUE;
 } /* Lists_AddInvited */
 
@@ -202,18 +200,6 @@ Lists_DeleteChannel( CHANNEL *Chan )
 } /* Lists_DeleteChannel */
 
 
-GLOBAL CHAR *
-Lists_MakeMask( CHAR *Pattern )
-{
-	assert( Pattern );
-
-	/* Hier sollte aus einem "beliebigen" Pattern eine
-	 * gueltige IRC-Mask erzeugt werden ... */
-	
-	return Pattern;
-} /* Lists_MakeMask */
-
-
 LOCAL C2C *
 New_C2C( CHAR *Mask, CHANNEL *Chan, BOOLEAN OnlyOnce )
 {
blob - a1996a31867fc602fd355165b43fec31db7c30bf
blob + 76bd7af2ee9e16dc5485bf0f26c34e104a990981
--- src/ngircd/lists.h
+++ src/ngircd/lists.h
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: lists.h,v 1.5 2002/08/26 23:39:22 alex Exp $
+ * $Id: lists.h,v 1.6 2002/08/26 23:47:58 alex Exp $
  *
  * lists.h: Verwaltung der "IRC-Listen": Ban, Invite, ... (Header)
  */
@@ -23,15 +23,13 @@ GLOBAL VOID Lists_Init PARAMS(( VOID ));
 GLOBAL VOID Lists_Exit PARAMS(( VOID ));
 
 GLOBAL BOOLEAN Lists_CheckInvited PARAMS(( CLIENT *Client, CHANNEL *Chan ));
-GLOBAL BOOLEAN Lists_AddInvited PARAMS(( CHAR *Mask, CHANNEL *Chan, BOOLEAN OnlyOnce ));
+GLOBAL BOOLEAN Lists_AddInvited PARAMS(( CHAR *Pattern, CHANNEL *Chan, BOOLEAN OnlyOnce ));
 
 GLOBAL BOOLEAN Lists_CheckBanned PARAMS(( CLIENT *Client, CHANNEL *Chan ));
 
 GLOBAL VOID Lists_DeleteChannel PARAMS(( CHANNEL *Chan ));
 
-GLOBAL CHAR *Lists_MakeMask PARAMS(( CHAR *Pattern ));
 
-
 #endif
 
 
blob - f8c10ee5d6ce4994eb3a04efe332019d73848f3d
blob + 72a388477563d9704d795790e11ba9e8ae2b2aad
--- src/ngircd/parse.c
+++ src/ngircd/parse.c
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: parse.c,v 1.36 2002/08/26 23:39:22 alex Exp $
+ * $Id: parse.c,v 1.37 2002/08/26 23:47:58 alex Exp $
  *
  * parse.c: Parsen der Client-Anfragen
  */
@@ -348,7 +348,6 @@ Handle_Request( CONN_ID Idx, REQUEST *Req )
 	else if( strcasecmp( Req->command, "INVITE" ) == 0 ) return IRC_INVITE( client, Req );
 	else if( strcasecmp( Req->command, "KICK" ) == 0 ) return IRC_KICK( client, Req );
 	else if( strcasecmp( Req->command, "BAN" ) == 0 ) return IRC_BAN( client, Req );
-	else if( strcasecmp( Req->command, "CONNECT" ) == 0 ) return IRC_CONNECT( client, Req );
 
 	/* Unbekannter Befehl */
 	if( Client_Type( client ) != CLIENT_SERVER ) IRC_WriteStrClient( client, ERR_UNKNOWNCOMMAND_MSG, Client_ID( client ), Req->command );