#include "portab.h"
-static char UNUSED id[] = "$Id: irc-server.c,v 1.31 2003/01/08 22:04:43 alex Exp $";
+static char UNUSED id[] = "$Id: irc-server.c,v 1.37 2004/05/11 00:01:11 alex Exp $";
#include "imp.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
+#include "defines.h"
#include "resolve.h"
#include "conn.h"
#include "conn-zip.h"
#include "client.h"
#include "channel.h"
#include "irc-write.h"
+#include "lists.h"
#include "log.h"
#include "messages.h"
#include "parse.h"
Client_SetType( Client, CLIENT_SERVER );
Conf_SetServer( i, con );
-#ifdef USE_ZLIB
+#ifdef ZLIB
/* Kompression initialisieren, wenn erforderlich */
if( strchr( Client_Flags( Client ), 'Z' ))
{
/* Send CHANINFO if the peer supports it */
if( strchr( Client_Flags( Client ), 'C' ))
{
+#ifdef DEBUG
+ Log( LOG_DEBUG, "Sending CHANINFO commands ..." );
+#endif
modes = Channel_Modes( chan );
topic = Channel_Topic( chan );
if( ! IRC_WriteStrClient( Client, "%s", str )) return DISCONNECTED;
}
+#ifdef IRCPLUS
+ if( strchr( Client_Flags( Client ), 'L' ))
+ {
+#ifdef DEBUG
+ Log( LOG_DEBUG, "Synchronizing INVITE- and BAN-lists ..." );
+#endif
+ /* Synchronize INVITE- and BAN-lists */
+ if( ! Lists_SendInvites( Client )) return DISCONNECTED;
+ if( ! Lists_SendBans( Client )) return DISCONNECTED;
+ }
+#endif
+
/* naechsten Channel suchen */
chan = Channel_Next( chan );
}
GLOBAL BOOLEAN
IRC_NJOIN( CLIENT *Client, REQUEST *Req )
{
- CHAR str[COMMAND_LEN], *channame, *ptr, modes[8];
+ CHAR nick_in[COMMAND_LEN], nick_out[COMMAND_LEN], *channame, *ptr, modes[8];
BOOLEAN is_op, is_voiced;
CHANNEL *chan;
CLIENT *c;
/* Falsche Anzahl Parameter? */
if( Req->argc != 2 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
- strlcpy( str, Req->argv[1], sizeof( str ));
+ strlcpy( nick_in, Req->argv[1], sizeof( nick_in ));
+ strcpy( nick_out, "" );
channame = Req->argv[0];
- ptr = strtok( str, "," );
+ ptr = strtok( nick_in, "," );
while( ptr )
{
is_op = is_voiced = FALSE;
/* Modes im Channel bekannt machen */
IRC_WriteStrChannelPrefix( Client, chan, Client, FALSE, "MODE %s +%s %s", channame, modes, Client_ID( c ));
}
+
+ if( nick_out[0] != '\0' ) strlcat( nick_out, ",", sizeof( nick_out ));
+ if( is_op ) strlcat( nick_out, "@", sizeof( nick_out ));
+ if( is_voiced ) strlcat( nick_out, "+", sizeof( nick_out ));
+ strlcat( nick_out, ptr, sizeof( nick_out ));
}
else Log( LOG_ERR, "Got NJOIN for unknown nick \"%s\" for channel \"%s\"!", ptr, channame );
}
/* an andere Server weiterleiten */
- IRC_WriteStrServersPrefix( Client, Client_ThisServer( ), "NJOIN %s :%s", Req->argv[0], Req->argv[1] );
+ if( nick_out[0] != '\0' ) IRC_WriteStrServersPrefix( Client, Client_ThisServer( ), "NJOIN %s :%s", Req->argv[0], nick_out );
return CONNECTED;
} /* IRC_NJOIN */