X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Fchannel.h;h=32623758744f9acc5f120f6c69621d7f8ff2ef51;hb=03628dbeaf40a9de34b3eb6d5bf6dd34eed8248c;hp=261c763be8a8f9680d81bcf6cb2e6d0d6a91c6e4;hpb=59b19ea6a3be3972c6e83e0e362e52b1669d64ef;p=ngircd.git diff --git a/src/ngircd/channel.h b/src/ngircd/channel.h index 261c763b..32623758 100644 --- a/src/ngircd/channel.h +++ b/src/ngircd/channel.h @@ -1,22 +1,22 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) + * Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * Please read the file COPYING, README and AUTHORS for more information. - * - * $Id: channel.h,v 1.34 2008/01/15 22:28:14 fw Exp $ - * - * Channel management (header) */ #ifndef __channel_h__ #define __channel_h__ +/** + * @file + * Channel management (header) + */ #if defined(__channel_c__) | defined(S_SPLINT_S) @@ -32,6 +32,7 @@ typedef struct _CHANNEL char modes[CHANNEL_MODE_LEN]; /* Channel modes */ array topic; /* Topic of the channel */ #ifndef STRICT_RFC + time_t creation_time; /* Channel creation time */ time_t topic_time; /* Time when topic was set */ char topic_who[CLIENT_NICK_LEN];/* Nickname of user that set topic */ #endif @@ -39,6 +40,7 @@ typedef struct _CHANNEL unsigned long maxusers; /* Maximum number of members (mode "l") */ struct list_head list_bans; /* list head of banned users */ struct list_head list_invites; /* list head of invited users */ + array keyfile; /* Name of the channel key file */ } CHANNEL; typedef struct _CLIENT2CHAN @@ -46,7 +48,7 @@ typedef struct _CLIENT2CHAN struct _CLIENT2CHAN *next; CLIENT *client; CHANNEL *channel; - char modes[CHANNEL_MODE_LEN]; /* User-Modes in dem Channel */ + char modes[CHANNEL_MODE_LEN]; /* User-Modes in Channel */ } CL2CHAN; #else @@ -63,12 +65,13 @@ GLOBAL void Channel_Init PARAMS(( void )); GLOBAL void Channel_InitPredefined PARAMS(( void )); GLOBAL void Channel_Exit PARAMS(( void )); -GLOBAL bool Channel_Join PARAMS(( CLIENT *Client, char *Name )); -GLOBAL bool Channel_Part PARAMS(( CLIENT *Client, CLIENT *Origin, char *Name, char *Reason )); +GLOBAL bool Channel_Join PARAMS(( CLIENT *Client, const char *Name )); +GLOBAL bool Channel_Part PARAMS(( CLIENT *Client, CLIENT *Origin, const char *Name, const char *Reason )); -GLOBAL void Channel_Quit PARAMS(( CLIENT *Client, char *Reason )); +GLOBAL void Channel_Quit PARAMS(( CLIENT *Client, const char *Reason )); -GLOBAL void Channel_Kick PARAMS(( CLIENT *Client, CLIENT *Origin, char *Name, char *Reason )); +GLOBAL void Channel_Kick PARAMS((CLIENT *Peer, CLIENT *Target, CLIENT *Origin, + const char *Name, const char *Reason)); GLOBAL unsigned long Channel_Count PARAMS(( void )); GLOBAL unsigned long Channel_MemberCount PARAMS(( CHANNEL *Chan )); @@ -80,12 +83,12 @@ GLOBAL char *Channel_Topic PARAMS(( CHANNEL *Chan )); GLOBAL char *Channel_Key PARAMS(( CHANNEL *Chan )); GLOBAL unsigned long Channel_MaxUsers PARAMS(( CHANNEL *Chan )); -GLOBAL void Channel_SetTopic PARAMS(( CHANNEL *Chan, CLIENT *Client, char *Topic )); -GLOBAL void Channel_SetModes PARAMS(( CHANNEL *Chan, char *Modes )); -GLOBAL void Channel_SetKey PARAMS(( CHANNEL *Chan, char *Key )); +GLOBAL void Channel_SetTopic PARAMS(( CHANNEL *Chan, CLIENT *Client, const char *Topic )); +GLOBAL void Channel_SetModes PARAMS(( CHANNEL *Chan, const char *Modes )); +GLOBAL void Channel_SetKey PARAMS(( CHANNEL *Chan, const char *Key )); GLOBAL void Channel_SetMaxUsers PARAMS(( CHANNEL *Chan, unsigned long Count )); -GLOBAL CHANNEL *Channel_Search PARAMS(( char *Name )); +GLOBAL CHANNEL *Channel_Search PARAMS(( const char *Name )); GLOBAL CHANNEL *Channel_First PARAMS(( void )); GLOBAL CHANNEL *Channel_Next PARAMS(( CHANNEL *Chan )); @@ -109,14 +112,16 @@ GLOBAL char *Channel_UserModes PARAMS(( CHANNEL *Chan, CLIENT *Client )); GLOBAL bool Channel_IsMemberOf PARAMS(( CHANNEL *Chan, CLIENT *Client )); -GLOBAL bool Channel_Write PARAMS(( CHANNEL *Chan, CLIENT *From, CLIENT *Client, const char *Text )); -GLOBAL bool Channel_Notice PARAMS(( CHANNEL *Chan, CLIENT *From, CLIENT *Client, const char *Text)); +GLOBAL bool Channel_Write PARAMS((CHANNEL *Chan, CLIENT *From, CLIENT *Client, + const char *Command, bool SendErrors, + const char *Text)); -GLOBAL CHANNEL *Channel_Create PARAMS(( char *Name )); +GLOBAL CHANNEL *Channel_Create PARAMS(( const char *Name )); #ifndef STRICT_RFC GLOBAL unsigned int Channel_TopicTime PARAMS(( CHANNEL *Chan )); GLOBAL char *Channel_TopicWho PARAMS(( CHANNEL *Chan )); +GLOBAL unsigned int Channel_CreationTime PARAMS(( CHANNEL *Chan )); #endif GLOBAL bool Channel_AddInvite PARAMS((CHANNEL *c, const char *Mask, bool OnlyOnce )); @@ -124,5 +129,19 @@ GLOBAL bool Channel_AddBan PARAMS((CHANNEL *c, const char *Mask )); GLOBAL bool Channel_ShowBans PARAMS((CLIENT *client, CHANNEL *c)); GLOBAL bool Channel_ShowInvites PARAMS((CLIENT *client, CHANNEL *c)); + +GLOBAL void Channel_LogServer PARAMS((const char *msg)); + +GLOBAL bool Channel_CheckKey PARAMS((CHANNEL *Chan, CLIENT *Client, + const char *Key)); + +GLOBAL void Channel_CheckAdminRights PARAMS((CHANNEL *Chan, CLIENT *Client, + CLIENT *Origin, bool *OnChannel, + bool *AdminOk, bool *UseServerMode)); + +#define Channel_IsLocal(c) (Channel_Name(c)[0] == '&') +#define Channel_IsModeless(c) (Channel_Name(c)[0] == '+') + #endif + /* -eof- */