00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _EGG_MOD_IRC_IRC_H
00026 #define _EGG_MOD_IRC_IRC_H
00027
00028 #define check_tcl_join(a,b,c,d) check_tcl_joinspltrejn(a,b,c,d,H_join)
00029 #define check_tcl_splt(a,b,c,d) check_tcl_joinspltrejn(a,b,c,d,H_splt)
00030 #define check_tcl_rejn(a,b,c,d) check_tcl_joinspltrejn(a,b,c,d,H_rejn)
00031 #define check_tcl_sign(a,b,c,d,e) check_tcl_signtopcnick(a,b,c,d,e,H_sign)
00032 #define check_tcl_topc(a,b,c,d,e) check_tcl_signtopcnick(a,b,c,d,e,H_topc)
00033 #define check_tcl_nick(a,b,c,d,e) check_tcl_signtopcnick(a,b,c,d,e,H_nick)
00034
00035 #define REVENGE_KICK 1
00036 #define REVENGE_DEOP 2
00037
00038 #ifdef MAKING_IRC
00039 static void check_tcl_need(char *, char *);
00040 static void check_tcl_kick(char *, char *, struct userrec *, char *, char *, char *);
00041 static void check_tcl_mode(char *, char *, struct userrec *, char *, char *, char *);
00042 static void check_tcl_joinspltrejn(char *, char *, struct userrec *, char *,
00043 p_tcl_bind_list);
00044 static void check_tcl_part(char *, char *, struct userrec *, char *, char *);
00045 static void check_tcl_signtopcnick(char *, char *, struct userrec *u, char *,
00046 char *, p_tcl_bind_list);
00047 static int check_tcl_pubm(char *, char *, char *, char *);
00048 static int check_tcl_pub(char *, char *, char *, char *);
00049 static int me_op(struct chanset_t *);
00050 static int me_halfop(struct chanset_t *);
00051 static int me_voice(struct chanset_t *);
00052 static int any_ops(struct chanset_t *);
00053 static int hand_on_chan(struct chanset_t *, struct userrec *);
00054 static char *getchanmode(struct chanset_t *);
00055 static void flush_mode(struct chanset_t *, int);
00056 static void set_delay(struct chanset_t *, char *);
00057 static void refresh_who_chan(char *);
00058
00059
00060
00061
00062 #define resetbans(chan) resetmasks((chan), (chan)->channel.ban, \
00063 (chan)->bans, global_bans, 'b')
00064 #define resetexempts(chan) resetmasks((chan), (chan)->channel.exempt, \
00065 (chan)->exempts, global_exempts, 'e')
00066 #define resetinvites(chan) resetmasks((chan), (chan)->channel.invite, \
00067 (chan)->invites, global_invites, 'I')
00068
00069 static void reset_chan_info(struct chanset_t *, int);
00070 static void recheck_channel(struct chanset_t *, int);
00071 static void set_key(struct chanset_t *, char *);
00072 static void maybe_revenge(struct chanset_t *, char *, char *, int);
00073 static int detect_chan_flood(char *, char *, char *, struct chanset_t *, int,
00074 char *);
00075 static void newmask(masklist *, char *, char *);
00076 static char *quickban(struct chanset_t *, char *);
00077 static void got_op(struct chanset_t *chan, char *nick, char *from, char *who,
00078 struct userrec *opu, struct flag_record *opper);
00079 static void got_halfop(struct chanset_t *chan, char *nick, char *from,
00080 char *who, struct userrec *opu,
00081 struct flag_record *opper);
00082 static int killmember(struct chanset_t *chan, char *nick);
00083 static void check_lonely_channel(struct chanset_t *chan);
00084 static int gotmode(char *, char *);
00085
00086 #define newban(chan, mask, who) newmask((chan)->channel.ban, mask, who)
00087 #define newexempt(chan, mask, who) newmask((chan)->channel.exempt, mask, \
00088 who)
00089 #define newinvite(chan, mask, who) newmask((chan)->channel.invite, mask, \
00090 who)
00091 #else
00092
00093 #define H_splt (*(p_tcl_bind_list*)(irc_funcs[4]))
00094 #define H_rejn (*(p_tcl_bind_list*)(irc_funcs[5]))
00095 #define H_nick (*(p_tcl_bind_list*)(irc_funcs[6]))
00096 #define H_sign (*(p_tcl_bind_list*)(irc_funcs[7]))
00097
00098 #define H_join (*(p_tcl_bind_list*)(irc_funcs[8]))
00099 #define H_part (*(p_tcl_bind_list*)(irc_funcs[9]))
00100 #define H_mode (*(p_tcl_bind_list*)(irc_funcs[10]))
00101 #define H_kick (*(p_tcl_bind_list*)(irc_funcs[11]))
00102
00103 #define H_pubm (*(p_tcl_bind_list*)(irc_funcs[12]))
00104 #define H_pub (*(p_tcl_bind_list*)(irc_funcs[13]))
00105 #define H_topc (*(p_tcl_bind_list*)(irc_funcs[14]))
00106
00107
00108 #define me_op ((int(*)(struct chanset_t *))irc_funcs[16])
00109
00110 #define H_need (*(p_tcl_bind_list*)(irc_funcs[18]))
00111
00112
00113
00114
00115 #define me_halfop ((int(*)(struct chanset_t *))irc_funcs[22])
00116 #define me_voice ((int(*)(struct chanset_t *))irc_funcs[23])
00117
00118 #define getchanmode ((char *(*)(struct chanset_t *))irc_funcs[24])
00119
00120 #endif
00121
00122 #endif