commit - 7b6cfc17c428b9c9b58fcb9204337d5c4329f98b
commit + d645ce86e9440a891b80bfd2907617e16aa799e8
blob - 38dc4684acef6109138b7ccda346dc6240bf5e1b
blob + 43b07e0f95c3fbaede51e80b2da087280abf4a48
--- src/ngircd/channel.c
+++ src/ngircd/channel.c
* 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.28 2002/06/09 13:15:58 alex Exp $
+ * $Id: channel.c,v 1.29 2002/08/26 23:39:22 alex Exp $
*
* channel.c: Management der Channels
*/
CHAR x[2], *p;
assert( Chan != NULL );
+ assert( Mode > ' ' );
x[0] = Mode; x[1] = '\0';
assert( Chan != NULL );
assert( Client != NULL );
+ assert( Mode > ' ' );
cl2chan = Get_Cl2Chan( Chan, Client );
assert( cl2chan != NULL );
blob - 7160afda85f78db29c7ce054b83ba032b104b318
blob + 9e36c516b4113a95346ee48a6b8edfc977e43b58
--- src/ngircd/irc-channel.c
+++ src/ngircd/irc-channel.c
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: irc-channel.c,v 1.10 2002/06/26 15:44:15 alex Exp $
+ * $Id: irc-channel.c,v 1.11 2002/08/26 23:39:22 alex Exp $
*
* irc-channel.c: IRC-Channel-Befehle
*/
if( modes[1] )
{
/* Modes im Channel bekannt machen */
- IRC_WriteStrChannelPrefix( Client, chan, target, FALSE, "MODE %s %s :%s", channame, modes, Client_ID( target ));
+ IRC_WriteStrChannelPrefix( Client, chan, target, FALSE, "MODE %s +%s :%s", channame, &modes[1], Client_ID( target ));
}
if( Client_Type( Client ) == CLIENT_USER )
blob - c47345ae457e693b824b43131408c0036d63d7e9
blob + 73703e577862d7d99e995133367d57068e23fec9
--- src/ngircd/irc-mode.c
+++ src/ngircd/irc-mode.c
* 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.7 2002/06/02 15:14:22 alex Exp $
+ * $Id: irc-mode.c,v 1.8 2002/08/26 23:39:22 alex Exp $
*
* irc-mode.c: IRC-Befehle zur Mode-Aenderung (MODE, AWAY, ...)
*/
#include "channel.h"
#include "defines.h"
#include "irc-write.h"
+#include "lists.h"
#include "log.h"
#include "parse.h"
#include "messages.h"
#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 )
{
/* 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 ))
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, "+" );
} /* 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 - 57b69bdaf508b8dc7f0b599356a9edd32c310ca3
blob + ea64958aea93e734ce083b3b3f6a57e4e6563f88
--- src/ngircd/irc-oper.c
+++ src/ngircd/irc-oper.c
* 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.5 2002/05/27 13:09:27 alex Exp $
+ * $Id: irc-oper.c,v 1.6 2002/08/26 23:39:22 alex Exp $
*
* irc-oper.c: IRC-Operator-Befehle
*/
} /* 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 - b1ce132fe554f228e5b6048e72147cfa4215917d
blob + 088cf089f6b9d9ac9b6d5386b45be2c0c9fe41e5
--- src/ngircd/irc-oper.h
+++ src/ngircd/irc-oper.h
* 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.3 2002/05/27 13:09:27 alex Exp $
+ * $Id: irc-oper.h,v 1.4 2002/08/26 23:39:22 alex Exp $
*
* irc-oper.h: IRC-Operator-Befehle (Header)
*/
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 - c3c4138c6d5bc234c2c66b4d370eff10a2d2688d
blob + 12de0815c3d48eb60f5629d303924ce458135d3c
--- src/ngircd/irc-server.c
+++ src/ngircd/irc-server.c
* 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.12 2002/07/25 12:33:19 alex Exp $
+ * $Id: irc-server.c,v 1.13 2002/08/26 23:39:22 alex Exp $
*
* irc-server.c: IRC-Befehle fuer Server-Links
*/
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\" for channel \"%s\"!", ptr, channame );
+ else Log( LOG_ERR, "Got NJOIN for unknown nick \"%s\", channel \"%s\"!", ptr, channame );
/* naechsten Nick suchen */
ptr = strtok( NULL, "," );
blob - 96a7ce64ed5f3dc050c4823149afa49e84345925
blob + 21355f3d2a7bff3f9b41c25d800a11283c8ec0dd
--- src/ngircd/lists.c
+++ src/ngircd/lists.c
* 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.4 2002/07/15 16:35:21 alex Exp $
+ * $Id: lists.c,v 1.5 2002/08/26 23:39:22 alex Exp $
*
* lists.c: Verwaltung der "IRC-Listen": Ban, Invite, ...
*/
#include "client.h"
#include "channel.h"
#include "log.h"
+#include "match.h"
#include <stdlib.h>
#include <string.h>
if( c2c->channel == Chan )
{
/* Ok, richtiger Channel. Passt die Maske? */
- if( strcasecmp( Client_Mask( Client ), c2c->mask ) == 0 )
+Log( LOG_DEBUG, "%s : %s", Client_Mask( Client ), c2c->mask );
+ if( Match( Client_Mask( Client ), c2c->mask ))
{
/* Treffer! */
if( c2c->onlyonce )
GLOBAL BOOLEAN
-Lists_AddInvited( CHAR *Pattern, CHANNEL *Chan, BOOLEAN OnlyOnce )
+Lists_AddInvited( CHAR *Mask, CHANNEL *Chan, BOOLEAN OnlyOnce )
{
C2C *c2c;
- assert( Pattern != NULL );
+ assert( Mask != NULL );
assert( Chan != NULL );
- c2c = New_C2C( Pattern, Chan, OnlyOnce );
+ c2c = New_C2C( Mask, Chan, OnlyOnce );
if( ! c2c )
{
Log( LOG_ERR, "Can't add new invite list entry!" );
c2c->next = My_Invites;
My_Invites = c2c;
- Log( LOG_DEBUG, "Added \"%s\" to invite list for \"%s\".", Pattern, Channel_Name( Chan ));
+ Log( LOG_DEBUG, "Added \"%s\" to invite list for \"%s\".", Mask, Channel_Name( Chan ));
return TRUE;
} /* Lists_AddInvited */
} /* 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 - f00bca11e906fe9a7cf24c241d7b9754a059162b
blob + a1996a31867fc602fd355165b43fec31db7c30bf
--- src/ngircd/lists.h
+++ src/ngircd/lists.h
* 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.4 2002/07/15 16:35:21 alex Exp $
+ * $Id: lists.h,v 1.5 2002/08/26 23:39:22 alex Exp $
*
* lists.h: Verwaltung der "IRC-Listen": Ban, Invite, ... (Header)
*/
GLOBAL VOID Lists_Exit PARAMS(( VOID ));
GLOBAL BOOLEAN Lists_CheckInvited PARAMS(( CLIENT *Client, CHANNEL *Chan ));
-GLOBAL BOOLEAN Lists_AddInvited PARAMS(( CHAR *Pattern, CHANNEL *Chan, BOOLEAN OnlyOnce ));
+GLOBAL BOOLEAN Lists_AddInvited PARAMS(( CHAR *Mask, 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 - 5fbb66829051c12937be619ba7201cd04a128851
blob + f8c10ee5d6ce4994eb3a04efe332019d73848f3d
--- src/ngircd/parse.c
+++ src/ngircd/parse.c
* 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.35 2002/07/29 20:35:33 alex Exp $
+ * $Id: parse.c,v 1.36 2002/08/26 23:39:22 alex Exp $
*
* parse.c: Parsen der Client-Anfragen
*/
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 );