mirror of
https://github.com/osmarks/ngircd.git
synced 2025-06-23 16:54:08 +00:00
Don't forward NJOIN's for unknown nick names.
This commit is contained in:
parent
0391d35a67
commit
feafb6cb2e
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#include "portab.h"
|
#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.32 2003/04/20 23:09:26 alex Exp $";
|
||||||
|
|
||||||
#include "imp.h"
|
#include "imp.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -294,7 +294,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
|
|||||||
GLOBAL BOOLEAN
|
GLOBAL BOOLEAN
|
||||||
IRC_NJOIN( CLIENT *Client, REQUEST *Req )
|
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;
|
BOOLEAN is_op, is_voiced;
|
||||||
CHANNEL *chan;
|
CHANNEL *chan;
|
||||||
CLIENT *c;
|
CLIENT *c;
|
||||||
@ -305,10 +305,11 @@ IRC_NJOIN( CLIENT *Client, REQUEST *Req )
|
|||||||
/* Falsche Anzahl Parameter? */
|
/* Falsche Anzahl Parameter? */
|
||||||
if( Req->argc != 2 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
|
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];
|
channame = Req->argv[0];
|
||||||
ptr = strtok( str, "," );
|
ptr = strtok( nick_in, "," );
|
||||||
while( ptr )
|
while( ptr )
|
||||||
{
|
{
|
||||||
is_op = is_voiced = FALSE;
|
is_op = is_voiced = FALSE;
|
||||||
@ -341,6 +342,9 @@ IRC_NJOIN( CLIENT *Client, REQUEST *Req )
|
|||||||
/* Modes im Channel bekannt machen */
|
/* Modes im Channel bekannt machen */
|
||||||
IRC_WriteStrChannelPrefix( Client, chan, Client, FALSE, "MODE %s +%s %s", channame, modes, Client_ID( c ));
|
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 ));
|
||||||
|
strlcat( nick_out, ptr, sizeof( nick_out ));
|
||||||
}
|
}
|
||||||
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\" for channel \"%s\"!", ptr, channame );
|
||||||
|
|
||||||
@ -349,7 +353,7 @@ IRC_NJOIN( CLIENT *Client, REQUEST *Req )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* an andere Server weiterleiten */
|
/* 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;
|
return CONNECTED;
|
||||||
} /* IRC_NJOIN */
|
} /* IRC_NJOIN */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user