ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/include/channel.h
(Generate patch)

Comparing ircd-hybrid/trunk/include/channel.h (file contents):
Revision 1751 by michael, Wed Jan 16 18:30:52 2013 UTC vs.
Revision 6982 by michael, Wed Dec 23 19:49:38 2015 UTC

# Line 1 | Line 1
1   /*
2 < *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
2 > *  ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3   *
4 < *  Copyright (C) 2002 by the past and present ircd coders, and others.
4 > *  Copyright (c) 1997-2015 ircd-hybrid development team
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
# Line 15 | Line 15
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
18 > *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19   *  USA
20   */
21  
# Line 29 | Line 29
29  
30   #include "ircd_defs.h"        /* KEYLEN, CHANNELLEN */
31  
32 + /* channel visible */
33 + #define ShowChannel(v,c)        (PubChannel(c) || IsMember((v),(c)))
34 +
35 + #define IsMember(who, chan) ((find_channel_link(who, chan)) ? 1 : 0)
36 + #define AddMemberFlag(x, y) ((x)->flags |=  (y))
37 + #define DelMemberFlag(x, y) ((x)->flags &= ~(y))
38 +
39 + enum
40 + {
41 +  MSG_FLOOD_NOTICED  = 0x00000001U,
42 +  JOIN_FLOOD_NOTICED = 0x00000002U
43 + };
44 +
45 + #define SetFloodNoticed(x)   ((x)->flags |= MSG_FLOOD_NOTICED)
46 + #define IsSetFloodNoticed(x) ((x)->flags & MSG_FLOOD_NOTICED)
47 + #define ClearFloodNoticed(x) ((x)->flags &= ~MSG_FLOOD_NOTICED)
48 +
49 + #define SetJoinFloodNoticed(x)   ((x)->flags |= JOIN_FLOOD_NOTICED)
50 + #define IsSetJoinFloodNoticed(x) ((x)->flags & JOIN_FLOOD_NOTICED)
51 + #define ClearJoinFloodNoticed(x) ((x)->flags &= ~JOIN_FLOOD_NOTICED)
52 +
53   struct Client;
54  
55   /*! \brief Mode structure for channels */
56   struct Mode
57   {
58 <  unsigned int mode;   /*!< simple modes */
59 <  unsigned int limit;  /*!< +l userlimit */
60 <  char key[KEYLEN + 1];    /*!< +k key */
58 >  unsigned int mode;   /**< simple modes */
59 >  unsigned int limit;  /**< +l userlimit */
60 >  char key[KEYLEN + 1];    /**< +k key */
61   };
62  
63   /*! \brief Channel structure */
# Line 48 | Line 69 | struct Channel
69    struct Mode mode;
70  
71    char topic[TOPICLEN + 1];
72 <  char topic_info[USERHOST_REPLYLEN];
72 >  char topic_info[NICKLEN + USERLEN + HOSTLEN + 3];
73  
74 <  time_t channelts;
74 >  time_t creationtime;
75    time_t topic_time;
76 <  time_t last_knock; /*!< don't allow knock to flood */
76 >  time_t last_knock;  /**< Don't allow knock to flood */
77 >  time_t last_invite;
78    time_t last_join_time;
79    time_t first_received_message_time; /*!< channel flood control */
80    unsigned int flags;
81    int received_number_of_privmsgs;
82  
83 +  dlink_list locmembers;  /*!< local members are here too */
84    dlink_list members;
85    dlink_list invites;
86    dlink_list banlist;
# Line 66 | Line 89 | struct Channel
89  
90    float number_joined;
91  
92 <  char chname[CHANNELLEN + 1];
92 >  char name[CHANNELLEN + 1];
93 >  size_t name_len;
94   };
95  
96   /*! \brief Membership structure */
97   struct Membership
98   {
99 <  dlink_node channode;     /*!< link to chptr->members    */
100 <  dlink_node usernode;     /*!< link to source_p->channel */
101 <  struct Channel *chptr;   /*!< Channel pointer */
102 <  struct Client *client_p; /*!< Client pointer */
103 <  unsigned int flags;      /*!< user/channel flags, e.g. CHFL_CHANOP */
99 >  dlink_node locchannode;  /**< link to chptr->locmembers */
100 >  dlink_node channode;     /**< link to chptr->members    */
101 >  dlink_node usernode;     /**< link to source_p->channel */
102 >  struct Channel *chptr;   /**< Channel pointer */
103 >  struct Client *client_p; /**< Client pointer */
104 >  unsigned int flags;      /**< user/channel flags, e.g. CHFL_CHANOP */
105   };
106  
107 < /*! \brief Ban structure.  Used for b/e/I n!u\@h masks */
107 > /*! \brief Ban structure. Used for b/e/I n!u\@h masks */
108   struct Ban
109   {
110    dlink_node node;
111 <  char *name;
112 <  char *username;
113 <  char *host;
114 <  char *who;
111 >  char name[NICKLEN + 1];
112 >  char user[USERLEN + 1];
113 >  char host[HOSTLEN + 1];
114 >  char who[NICKLEN + USERLEN + HOSTLEN + 3];
115    size_t len;
116    time_t when;
117    struct irc_ssaddr addr;
# Line 94 | Line 119 | struct Ban
119    int type;
120   };
121  
122 < extern dlink_list global_channel_list;
122 > extern dlink_list channel_list;
123  
124 < extern int check_channel_name(const char *, int);
125 < extern int can_send(struct Channel *, struct Client *, struct Membership *);
124 > extern int channel_check_name(const char *, const int);
125 > extern int can_send(struct Channel *, struct Client *, struct Membership *, const char *, int);
126   extern int is_banned(const struct Channel *, const struct Client *);
127 < extern int can_join(struct Client *, struct Channel *, const char *);
103 < extern int has_member_flags(struct Membership *, unsigned int);
127 > extern int has_member_flags(const struct Membership *, const unsigned int);
128  
129 + extern void channel_do_join(struct Client *, char *, char *);
130 + extern void channel_do_join_0(struct Client *);
131 + extern void channel_do_part(struct Client *, char *, const char *);
132   extern void remove_ban(struct Ban *, dlink_list *);
133 < extern void init_channels(void);
134 < extern void add_user_to_channel(struct Channel *, struct Client *,
108 <                                unsigned int, int);
133 > extern void channel_init(void);
134 > extern void add_user_to_channel(struct Channel *, struct Client *, unsigned int, int);
135   extern void remove_user_from_channel(struct Membership *);
136   extern void channel_member_names(struct Client *, struct Channel *, int);
137   extern void add_invite(struct Channel *, struct Client *);
138   extern void del_invite(struct Channel *, struct Client *);
139 < extern void send_channel_modes(struct Client *, struct Channel *);
139 > extern void clear_invites_channel(struct Channel *);
140 > extern void clear_invites_client(struct Client *);
141 > extern void channel_send_modes(struct Client *, struct Channel *);
142   extern void channel_modes(struct Channel *, struct Client *, char *, char *);
143   extern void check_spambot_warning(struct Client *, const char *);
144 < extern void check_splitmode(void *);
145 < extern void free_channel_list(dlink_list *);
118 < extern void destroy_channel(struct Channel *);
119 < extern void set_channel_topic(struct Channel *, const char *, const char *, time_t, int);
144 > extern void channel_free(struct Channel *);
145 > extern void channel_set_topic(struct Channel *, const char *, const char *, time_t, int);
146  
147 < extern const char *get_member_status(const struct Membership *, int);
147 > extern const char *get_member_status(const struct Membership *, const int);
148  
149 < extern struct Channel *make_channel(const char *);
149 > extern struct Channel *channel_make(const char *);
150   extern struct Membership *find_channel_link(struct Client *, struct Channel *);
151 <
126 < /* channel visible */
127 < #define ShowChannel(v,c)        (PubChannel(c) || IsMember((v),(c)))
128 <
129 < #define IsMember(who, chan) ((find_channel_link(who, chan)) ? 1 : 0)
130 < #define AddMemberFlag(x, y) ((x)->flags |=  (y))
131 < #define DelMemberFlag(x, y) ((x)->flags &= ~(y))
132 <
133 < #define FLOOD_NOTICED           1
134 < #define JOIN_FLOOD_NOTICED      2
135 <
136 < #define SetFloodNoticed(x)   ((x)->flags |= FLOOD_NOTICED)
137 < #define IsSetFloodNoticed(x) ((x)->flags & FLOOD_NOTICED)
138 < #define ClearFloodNoticed(x) ((x)->flags &= ~FLOOD_NOTICED)
139 <
140 < #define SetJoinFloodNoticed(x)   ((x)->flags |= JOIN_FLOOD_NOTICED)
141 < #define IsSetJoinFloodNoticed(x) ((x)->flags & JOIN_FLOOD_NOTICED)
142 < #define ClearJoinFloodNoticed(x) ((x)->flags &= ~JOIN_FLOOD_NOTICED)
143 <
144 < #endif  /* INCLUDED_channel_h */
151 > #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)