* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, email srvx-maintainers@srvx.net.
+ * along with srvx; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-#define CHANNEL_NODELETE 0x00000001 /* (1 << 0) */
-#define CHANNEL_SUSPENDED 0x00000002 /* (1 << 1) */
-#define CHANNEL_INFO_LINES 0x00000004 /* (1 << 2) - DEPRECATED */
-#define CHANNEL_VOICE_ALL 0x00000008 /* (1 << 3) - DEPRECATED */
+#define CHANNEL_NODELETE 0x00000001 /* (1 << 0) */
+#define CHANNEL_SUSPENDED 0x00000002 /* (1 << 1) */
+#define CHANNEL_INFO_LINES 0x00000004 /* (1 << 2) - DEPRECATED */
+#define CHANNEL_VOICE_ALL 0x00000008 /* (1 << 3) - DEPRECATED */
-#define CHANNEL_DYNAMIC_LIMIT 0x00000020 /* (1 << 5) */
-#define CHANNEL_TOPIC_SNARF 0x00000040 /* (1 << 6) - DEPRECATED */
+#define CHANNEL_DYNAMIC_LIMIT 0x00000020 /* (1 << 5) */
+#define CHANNEL_TOPIC_SNARF 0x00000040 /* (1 << 6) - DEPRECATED */
/* Flags with values over 0x20000000 or (1 << 29) will not work
* because chanData.flags is a 30-bit field.
*/
/* Flags with values over 0x20000000 or (1 << 29) will not work
* because chanData.flags is a 30-bit field.
*/
-#define IsProtected(x) ((x)->flags & CHANNEL_NODELETE)
-#define IsSuspended(x) ((x)->flags & CHANNEL_SUSPENDED)
+#define IsProtected(x) ((x)->flags & CHANNEL_NODELETE)
+#define IsSuspended(x) ((x)->flags & CHANNEL_SUSPENDED)
+#define IsOffChannel(x) (((x)->flags & CHANNEL_OFFCHANNEL) && (off_channel > 1))
+
+#define MAXADVTOPICENTRIES 9
unsigned int last_refresh;
unsigned short banCount;
unsigned short userCount;
unsigned short lvlOpts[NUM_LEVEL_OPTIONS];
unsigned char chOpts[NUM_CHAR_OPTIONS];
unsigned int last_refresh;
unsigned short banCount;
unsigned short userCount;
unsigned short lvlOpts[NUM_LEVEL_OPTIONS];
unsigned char chOpts[NUM_CHAR_OPTIONS];
+#define GetChannelUser(channel, handle) _GetChannelUser(channel, handle, 1, 0)
+struct userData *_GetChannelUser(struct chanData *channel, struct handle_info *handle, int override, int allow_suspended);
+struct banData *add_channel_ban(struct chanData *channel, const char *mask, char *owner, unsigned long set, unsigned long triggered, unsigned long expires, char *reason);
void init_chanserv(const char *nick);
void del_channel_user(struct userData *user, int do_gc);
struct channelList *chanserv_support_channels(void);
unsigned short user_level_from_name(const char *name, unsigned short clamp_level);
struct do_not_register *chanserv_is_dnr(const char *chan_name, struct handle_info *handle);
int check_user_level(struct chanNode *channel, struct userNode *user, enum levelOption opt, int allow_override, int exempt_owner);
void init_chanserv(const char *nick);
void del_channel_user(struct userData *user, int do_gc);
struct channelList *chanserv_support_channels(void);
unsigned short user_level_from_name(const char *name, unsigned short clamp_level);
struct do_not_register *chanserv_is_dnr(const char *chan_name, struct handle_info *handle);
int check_user_level(struct chanNode *channel, struct userNode *user, enum levelOption opt, int allow_override, int exempt_owner);