mirror of
https://github.com/osmarks/ngircd.git
synced 2025-06-25 22:52:52 +00:00
- IRC_KICK() implementiert.
This commit is contained in:
parent
a2119a660a
commit
234f9472c2
@ -9,7 +9,7 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: irc-op.c,v 1.1 2002/05/27 11:22:07 alex Exp $
|
* $Id: irc-op.c,v 1.2 2002/06/01 14:39:34 alex Exp $
|
||||||
*
|
*
|
||||||
* irc-op.c: Befehle zur Channel-Verwaltung
|
* irc-op.c: Befehle zur Channel-Verwaltung
|
||||||
*/
|
*/
|
||||||
@ -20,6 +20,7 @@
|
|||||||
#include "imp.h"
|
#include "imp.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "conn.h"
|
#include "conn.h"
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
@ -37,15 +38,26 @@
|
|||||||
GLOBAL BOOLEAN
|
GLOBAL BOOLEAN
|
||||||
IRC_KICK( CLIENT *Client, REQUEST *Req )
|
IRC_KICK( CLIENT *Client, REQUEST *Req )
|
||||||
{
|
{
|
||||||
|
CLIENT *target, *from;
|
||||||
|
|
||||||
assert( Client != NULL );
|
assert( Client != NULL );
|
||||||
assert( Req != NULL );
|
assert( Req != NULL );
|
||||||
|
|
||||||
/* Valider Client? */
|
/* Valider Client? */
|
||||||
if(( Client_Type( Client ) != CLIENT_USER ) && ( Client_Type( Client ) != CLIENT_SERVER )) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client ));
|
if(( Client_Type( Client ) != CLIENT_USER ) && ( Client_Type( Client ) != CLIENT_SERVER )) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client ));
|
||||||
|
|
||||||
/* Keine Parameter? */
|
/* Falsche Anzahl Parameter? */
|
||||||
if( Req->argc < 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
|
if(( Req->argc < 2) || ( Req->argc > 3 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
|
||||||
|
|
||||||
|
if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_Search( Req->prefix );
|
||||||
|
else from = Client;
|
||||||
|
if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
|
||||||
|
|
||||||
|
/* Ziel-User suchen */
|
||||||
|
target = Client_Search( Req->argv[1] );
|
||||||
|
if( ! target ) return IRC_WriteStrClient( from, ERR_NOSUCHNICK_MSG, Client_ID( from ), Req->argv[1] );
|
||||||
|
|
||||||
|
Channel_Kick( target, from, Req->argv[0], Req->argc == 3 ? Req->argv[2] : Client_ID( from ));
|
||||||
return CONNECTED;
|
return CONNECTED;
|
||||||
} /* IRC_KICK */
|
} /* IRC_KICK */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user