/[svn]/ircd-hybrid-7.2/include/channel.h
ViewVC logotype

Annotation of /ircd-hybrid-7.2/include/channel.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 454 - (hide annotations)
Sun Feb 12 19:01:25 2006 UTC (14 years, 1 month ago) by michael
File MIME type: text/x-csrc
File size: 4878 byte(s)
- Get rid of can_send_part. This also fixes a bug where voiced clients
  weren't able to send a PART message to the channel.  Reported by ThaPrince.

1 adx 30 /*
2     * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3     *
4     * Copyright (C) 2002 by the past and present ircd coders, and others.
5     *
6     * This program is free software; you can redistribute it and/or modify
7     * it under the terms of the GNU General Public License as published by
8     * the Free Software Foundation; either version 2 of the License, or
9     * (at your option) any later version.
10     *
11     * This program is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     * GNU General Public License for more details.
15     *
16     * You should have received a copy of the GNU General Public License
17     * along with this program; if not, write to the Free Software
18     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19     * USA
20     */
21    
22     /*! \file channel.h
23     * \brief Responsible for managing channels, members, bans and topics
24 knight 31 * \version $Id$
25 adx 30 */
26    
27     #ifndef INCLUDED_channel_h
28     #define INCLUDED_channel_h
29    
30     #include "ircd_defs.h" /* KEYLEN, CHANNELLEN */
31     #include "tools.h"
32    
33     struct Client;
34    
35     /*! \brief Mode structure for channels */
36     struct Mode
37     {
38     unsigned int mode; /*!< simple modes */
39     unsigned int limit; /*!< +l userlimit */
40     char key[KEYLEN]; /*!< +k key */
41     };
42    
43     /*! \brief Channel structure */
44     struct Channel
45     {
46     dlink_node node;
47    
48     struct Channel *hnextch;
49    
50     struct Mode mode;
51     char *topic;
52     char *topic_info;
53     time_t topic_time;
54     unsigned long lazyLinkChannelExists;
55     time_t last_knock; /*!< don't allow knock to flood */
56    
57     dlink_list members;
58     dlink_list locmembers; /*!< local members are here too */
59     dlink_list invites;
60     dlink_list banlist;
61     dlink_list exceptlist;
62     dlink_list invexlist;
63    
64     time_t first_received_message_time; /*!< channel flood control */
65     int received_number_of_privmsgs;
66     int flags;
67     float number_joined;
68     time_t last_join_time;
69    
70     time_t channelts;
71     char chname[CHANNELLEN + 1];
72     };
73    
74     /*! \brief Membership structure */
75     struct Membership
76     {
77     dlink_node channode; /*!< link to chptr->members */
78     dlink_node locchannode; /*!< link to chptr->locmembers */
79     dlink_node usernode; /*!< link to source_p->channel */
80     struct Channel *chptr; /*!< Channel pointer */
81     struct Client *client_p; /*!< Client pointer */
82     unsigned int flags; /*!< user/channel flags, e.g. CHFL_CHANOP */
83     };
84    
85     /*! \brief Ban structure. Used for b/e/I n!u\@h masks */
86     struct Ban
87     {
88     dlink_node node;
89     size_t len;
90     char *name;
91     char *username;
92     char *host;
93     char *who;
94     time_t when;
95 michael 371 struct irc_ssaddr addr;
96     int bits;
97     char type;
98 adx 30 };
99    
100     extern dlink_list global_channel_list;
101    
102     extern int check_channel_name(const char *);
103 michael 454 extern int can_send(struct Channel *, struct Client *, struct Membership *);
104 adx 30 extern int is_banned(struct Channel *, struct Client *);
105     extern int can_join(struct Client *, struct Channel *, const char *);
106     extern int has_member_flags(struct Membership *, unsigned int);
107    
108     extern void remove_ban(struct Ban *, dlink_list *);
109     extern void init_channels(void);
110     extern void add_user_to_channel(struct Channel *, struct Client *,
111     unsigned int, int);
112     extern void remove_user_from_channel(struct Membership *);
113     extern void channel_member_names(struct Client *, struct Channel *, int);
114     extern void add_invite(struct Channel *, struct Client *);
115     extern void del_invite(struct Channel *, struct Client *);
116     extern void send_channel_modes(struct Client *, struct Channel *);
117     extern void channel_modes(struct Channel *, struct Client *, char *, char *);
118     extern void check_spambot_warning(struct Client *, const char *);
119     extern void check_splitmode(void *);
120     extern void free_channel_list(dlink_list *);
121     extern void free_topic(struct Channel *);
122     extern void destroy_channel(struct Channel *);
123     extern void set_channel_topic(struct Channel *, const char *, const char *, time_t);
124    
125     extern const char *get_member_status(const struct Membership *, int);
126    
127     extern struct Channel *get_or_create_channel(struct Client *, const char *, int *);
128     extern struct Membership *find_channel_link(struct Client *, struct Channel *);
129    
130     /* channel visible */
131     #define ShowChannel(v,c) (PubChannel(c) || IsMember((v),(c)))
132    
133     #define IsMember(who, chan) ((find_channel_link(who, chan)) ? 1 : 0)
134     #define AddMemberFlag(x, y) ((x)->flags |= (y))
135     #define DelMemberFlag(x, y) ((x)->flags &= ~(y))
136    
137     #define FLOOD_NOTICED 1
138     #define JOIN_FLOOD_NOTICED 2
139    
140     #define SetFloodNoticed(x) ((x)->flags |= FLOOD_NOTICED)
141     #define IsSetFloodNoticed(x) ((x)->flags & FLOOD_NOTICED)
142     #define ClearFloodNoticed(x) ((x)->flags &= ~FLOOD_NOTICED)
143    
144     #define SetJoinFloodNoticed(x) ((x)->flags |= JOIN_FLOOD_NOTICED)
145     #define IsSetJoinFloodNoticed(x) ((x)->flags & JOIN_FLOOD_NOTICED)
146     #define ClearJoinFloodNoticed(x) ((x)->flags &= ~JOIN_FLOOD_NOTICED)
147    
148     #endif /* INCLUDED_channel_h */

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.26