*/
#ifndef INCLUDED_channel_h
#define INCLUDED_channel_h
-#ifndef INCLUDED_config_h
-#include "config.h"
-#endif
#ifndef INCLUDED_ircd_defs_h
#include "ircd_defs.h" /* NICKLEN */
#endif
#define KEYLEN 23
#define CHANNELLEN 200
-#define MAXBANS 30
-#define MAXBANLENGTH 1024
+
+#define MAXJOINARGS 15 /* number of slots for join buffer */
+#define STARTJOINLEN 10 /* fuzzy numbers */
+#define STARTCREATELEN 20
/*
* Macro's
* temporary TS; can be removed when all 2.10 */
#define MODE_LISTED 0x10000
#define MODE_SAVE 0x20000 /* save this mode-with-arg 'til later */
+#define MODE_FREE 0x40000 /* string needs to be passed to MyFree() */
+#define MODE_BURSTADDED 0x80000 /* channel was created by a BURST */
/*
* mode flags which take another parameter (With PARAmeterS)
*/
#define IsChannelName(name) (*(name) == '#' || \
IsModelessChannel(name) || IsLocalChannel(name))
-/*
- * Check if a sptr is an oper, and chptr is a local channel.
- */
-#define IsOperOnLocalChannel(sptr,chname) \
- ((IsAnOper(sptr)) && (IsLocalChannel(chname)))
-
typedef enum ChannelGetType {
CGT_NO_CREATE,
CGT_CREATE
*/
#define MAGIC_REMOTE_JOIN_TS 1270080000
-#ifdef OPER_WALK_THROUGH_LMODES
/*
* used in can_join to determine if an oper forced a join on a channel
*/
#define MAGIC_OPER_OVERRIDE 1000
-#endif
extern const char* const PartFmt1;
#define MODEBUF_DEST_OPMODE 0x0100 /* Send server mode as OPMODE */
#define MODEBUF_DEST_DEOP 0x0200 /* Deop the offender */
#define MODEBUF_DEST_BOUNCE 0x0400 /* Bounce the modes */
+#define MODEBUF_DEST_LOG 0x0800 /* Log the mode changes to OPATH */
#define MODEBUF_DEST_HACK2 0x2000 /* Send a HACK(2) notice, reverse */
#define MODEBUF_DEST_HACK3 0x4000 /* Send a HACK(3) notice, TS == 0 */
#define MB_STRING(mb, i) ((mb)->mb_modeargs[(i)].mbm_arg.mbma_string)
#define MB_CLIENT(mb, i) ((mb)->mb_modeargs[(i)].mbm_arg.mbma_client)
+struct JoinBuf {
+ struct Client *jb_source; /* Source of joins (ie, joiner) */
+ struct Client *jb_connect; /* Connection of joiner */
+ unsigned int jb_type; /* Type of join (JOIN or CREATE) */
+ char *jb_comment; /* part comment */
+ time_t jb_create; /* Creation timestamp */
+ unsigned int jb_count; /* Number of channels */
+ unsigned int jb_strlen; /* length so far */
+ struct Channel *jb_channels[MAXJOINARGS];
+ /* channels joined or whatever */
+};
+
+#define JOINBUF_TYPE_JOIN 0 /* send JOINs */
+#define JOINBUF_TYPE_CREATE 1 /* send CREATEs */
+#define JOINBUF_TYPE_PART 2 /* send PARTs */
+#define JOINBUF_TYPE_PARTALL 3 /* send local PARTs, but not remote */
+
extern struct Channel* GlobalChannelList;
extern int LocalChanOperMode;
extern char *pretty_mask(char *mask);
extern void del_invite(struct Client *cptr, struct Channel *chptr);
extern void list_next_channels(struct Client *cptr, int nr);
-extern void send_user_joins(struct Client *cptr, struct Client *user);
+extern void list_set_default(void); /* this belongs elsewhere! */
extern void modebuf_init(struct ModeBuf *mbuf, struct Client *source,
struct Client *connect, struct Channel *chan,
extern void modebuf_mode_uint(struct ModeBuf *mbuf, unsigned int mode,
unsigned int uint);
extern void modebuf_mode_string(struct ModeBuf *mbuf, unsigned int mode,
- char *string);
+ char *string, int free);
extern void modebuf_mode_client(struct ModeBuf *mbuf, unsigned int mode,
struct Client *client);
extern int modebuf_flush(struct ModeBuf *mbuf);
+extern void modebuf_extract(struct ModeBuf *mbuf, char *buf);
+
+extern void mode_ban_invalidate(struct Channel *chan);
+extern void mode_invite_clear(struct Channel *chan);
extern int mode_parse(struct ModeBuf *mbuf, struct Client *cptr,
struct Client *sptr, struct Channel *chptr,
#define MODE_PARSE_BOUNCE 0x08 /* we will be bouncing the modes */
#define MODE_PARSE_NOTOPER 0x10 /* send "not chanop" to user */
#define MODE_PARSE_NOTMEMBER 0x20 /* send "not member" to user */
+#define MODE_PARSE_WIPEOUT 0x40 /* wipe out +k and +l during burst */
+#define MODE_PARSE_BURST 0x80 /* be even more strict w/extra args */
+
+extern void joinbuf_init(struct JoinBuf *jbuf, struct Client *source,
+ struct Client *connect, unsigned int type,
+ char *comment, time_t create);
+extern void joinbuf_join(struct JoinBuf *jbuf, struct Channel *chan,
+ unsigned int flags);
+extern int joinbuf_flush(struct JoinBuf *jbuf);
#endif /* INCLUDED_channel_h */