From ea9b72ef79a3d15178f191f28b858d1f73b0fb6f Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Mon, 27 May 2002 11:22:07 +0000 Subject: [PATCH] - neues Modul "irc-op" begonnen. --- src/ngircd/irc-op.c | 85 +++++++++++++++++++++++++++++++++++++++++++++ src/ngircd/irc-op.h | 30 ++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 src/ngircd/irc-op.c create mode 100644 src/ngircd/irc-op.h diff --git a/src/ngircd/irc-op.c b/src/ngircd/irc-op.c new file mode 100644 index 00000000..e5e66d81 --- /dev/null +++ b/src/ngircd/irc-op.c @@ -0,0 +1,85 @@ +/* + * ngIRCd -- The Next Generation IRC Daemon + * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) + * + * Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen + * der GNU General Public License (GPL), wie von der Free Software Foundation + * herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2 + * der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version. + * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste + * 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 $ + * + * irc-op.c: Befehle zur Channel-Verwaltung + */ + + +#include "portab.h" + +#include "imp.h" +#include +#include + +#include "conn.h" +#include "client.h" +#include "channel.h" +#include "defines.h" +#include "irc-write.h" +#include "log.h" +#include "messages.h" +#include "parse.h" + +#include "exp.h" +#include "irc-op.h" + + +GLOBAL BOOLEAN +IRC_KICK( CLIENT *Client, REQUEST *Req ) +{ + assert( Client != NULL ); + assert( Req != NULL ); + + /* Valider Client? */ + if(( Client_Type( Client ) != CLIENT_USER ) && ( Client_Type( Client ) != CLIENT_SERVER )) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client )); + + /* Keine Parameter? */ + if( Req->argc < 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); + + return CONNECTED; +} /* IRC_KICK */ + + +GLOBAL BOOLEAN +IRC_BAN( CLIENT *Client, REQUEST *Req ) +{ + assert( Client != NULL ); + assert( Req != NULL ); + + /* Valider Client? */ + if(( Client_Type( Client ) != CLIENT_USER ) && ( Client_Type( Client ) != CLIENT_SERVER )) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client )); + + /* Keine Parameter? */ + if( Req->argc < 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); + + return CONNECTED; +} /* IRC_BAN */ + + +GLOBAL BOOLEAN +IRC_INVITE( CLIENT *Client, REQUEST *Req ) +{ + assert( Client != NULL ); + assert( Req != NULL ); + + /* Valider Client? */ + if(( Client_Type( Client ) != CLIENT_USER ) && ( Client_Type( Client ) != CLIENT_SERVER )) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client )); + + /* Keine Parameter? */ + if( Req->argc < 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); + + return CONNECTED; +} /* IRC_INVITE */ + + +/* -eof- */ diff --git a/src/ngircd/irc-op.h b/src/ngircd/irc-op.h new file mode 100644 index 00000000..106fb22d --- /dev/null +++ b/src/ngircd/irc-op.h @@ -0,0 +1,30 @@ +/* + * ngIRCd -- The Next Generation IRC Daemon + * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) + * + * Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen + * der GNU General Public License (GPL), wie von der Free Software Foundation + * herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2 + * der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version. + * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste + * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. + * + * $Id: irc-op.h,v 1.1 2002/05/27 11:22:07 alex Exp $ + * + * irc-op.h: Befehle zur Channel-Verwaltung (Header) + */ + + +#ifndef __irc_op_h__ +#define __irc_op_h__ + + +GLOBAL BOOLEAN IRC_KICK PARAMS(( CLIENT *Client, REQUEST *Req )); +GLOBAL BOOLEAN IRC_BAN PARAMS(( CLIENT *Client, REQUEST *Req )); +GLOBAL BOOLEAN IRC_INVITE PARAMS(( CLIENT *Client, REQUEST *Req )); + + +#endif + + +/* -eof- */ -- 2.39.2