X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/f1d4a7dbdfec20ef797d5675b036470ec04bd6d5..75fcdcad712524432db81dd26444d3cb0b79f541:/src/hash.h diff --git a/src/hash.h b/src/hash.h index 842f756..bc715f2 100644 --- a/src/hash.h +++ b/src/hash.h @@ -60,7 +60,7 @@ #define FLAGS_LOCOP 0x000002 /* Local operator +o */ #define FLAGS_INVISIBLE 0x000004 /* invisible +i */ #define FLAGS_WALLOP 0x000008 /* receives wallops +w */ -#define FLAGS_SERVNOTICE 0x000010 /* receives server notices +s */ +#define FLAGS_DUMMY 0x000010 /* user is not announced to other servers */ #define FLAGS_DEAF 0x000020 /* deaf +d */ #define FLAGS_SERVICE 0x000040 /* cannot be kicked, killed or deoped +k */ #define FLAGS_GLOBAL 0x000080 /* receives global messages +g */ @@ -85,7 +85,6 @@ #define IsInvisible(x) ((x)->modes & FLAGS_INVISIBLE) #define IsGlobal(x) ((x)->modes & FLAGS_GLOBAL) #define IsWallOp(x) ((x)->modes & FLAGS_WALLOP) -#define IsServNotice(x) ((x)->modes & FLAGS_SERVNOTICE) #define IsBotM(x) ((x)->modes & FLAGS_BOT) #define IsHideChans(x) ((x)->modes & FLAGS_HIDECHANS) #define IsHideIdle(x) ((x)->modes & FLAGS_HIDEIDLE) @@ -98,6 +97,7 @@ #define IsHiddenHost(x) ((x)->modes & FLAGS_HIDDEN_HOST) #define IsReggedNick(x) ((x)->modes & FLAGS_REGNICK) #define IsRegistering(x) ((x)->modes & FLAGS_REGISTERING) +#define IsDummy(x) ((x)->modes & FLAGS_DUMMY) #define IsFakeHost(x) ((x)->fakehost[0] != '\0') #define IsLocal(x) ((x)->uplink == self) @@ -151,6 +151,7 @@ enum Priv { PRIV_SEE_CHAN, /**< oper can see in secret chans */ PRIV_PROPAGATE, /**< propagate oper status */ PRIV_DISPLAY, /**< "Is an oper" displayed */ + PRIV_DISPLAY_MODE, /**< oper can set +H hide oper */ PRIV_SEE_OPERS, /**< display hidden opers */ PRIV_WIDE_GLINE, /**< oper can set wider G-lines */ PRIV_WIDE_ZLINE, /**< oper can set wider Z-Lines */ @@ -164,6 +165,11 @@ enum Priv { PRIV_HIDE_IDLE, /**< oper can set/unset user mode +I */ PRIV_XTRAOP, /**< oper can set/unset user mode +X */ PRIV_HIDE_CHANNELS, /**< oper can set/unset user mode +n */ + PRIV_FREEFORM, /**< oper can set any host on themseves using set host + as long as its a valid host */ + PRIV_REMOVE, /**< oper can force remove deactivated glines, + shuns and zlines. */ + PRIV_SPAMFILTER, /**< oper can set spamfilters via SPAMFILTER */ PRIV_LAST_PRIV /**< number of privileges */ }; @@ -222,8 +228,10 @@ struct userNode { char *mark; /* only filled if they are marked */ char *version_reply; /* only filled in if a version query was triggered */ + char *sslfp; /* only filled in if a mark SSLCLIFP is received */ time_t timestamp; /* Time of last nick change */ + time_t idle_since; struct server *uplink; /* Server that user is connected to */ struct modeList channels; /* Vector of channels user is in */ struct Privs privs; @@ -299,7 +307,7 @@ struct modeNode { struct server { char name[SERVERNAMEMAX+1]; time_t boot; - time_t link; + time_t link_time; char description[SERVERDESCRIPTMAX+1]; #ifdef WITH_PROTOCOL_P10 char numeric[COMBO_NUMERIC_LEN+1]; @@ -364,19 +372,23 @@ struct server* GetServerH(const char *name); /* using full name */ struct userNode* GetUserH(const char *nick); /* using nick */ struct chanNode* GetChannel(const char *name); struct modeNode* GetUserMode(struct chanNode* channel, struct userNode* user); +int userList_contains(struct userList *list, struct userNode *user); unsigned int IsUserP(struct userNode *user); -typedef void (*server_link_func_t) (struct server *server); -void reg_server_link_func(server_link_func_t handler); - -typedef int (*new_user_func_t) (struct userNode *user); -void reg_new_user_func(new_user_func_t handler); -typedef void (*del_user_func_t) (struct userNode *user, struct userNode *killer, const char *why); -void reg_del_user_func(del_user_func_t handler); -void unreg_del_user_func(del_user_func_t handler); +typedef int (*server_link_func_t) (struct server *server, void *extra); +void reg_server_link_func(server_link_func_t handler, void *extra); +void call_server_link_funcs(struct server *server); + +typedef int (*new_user_func_t) (struct userNode *user, void *extra); +void reg_new_user_func(new_user_func_t handler, void *extra); +void call_new_user_funcs(struct userNode *user); +typedef void (*del_user_func_t) (struct userNode *user, struct userNode *killer, const char *why, void *extra); +void reg_del_user_func(del_user_func_t handler, void *extra); +void call_del_user_funcs(struct userNode *user, struct userNode *killer, const char *why); +void unreg_del_user_func(del_user_func_t handler, void *extra); void ReintroduceUser(struct userNode* user); -typedef void (*nick_change_func_t)(struct userNode *user, const char *old_nick); -void reg_nick_change_func(nick_change_func_t handler); +typedef void (*nick_change_func_t)(struct userNode *user, const char *old_nick, void *extra); +void reg_nick_change_func(nick_change_func_t handler, void *extra); void NickChange(struct userNode* user, const char *new_nick, int no_announce); void SVSNickChange(struct userNode* user, const char *new_nick); @@ -387,10 +399,10 @@ void StampUser(struct userNode *user, const char *stamp, time_t timestamp); void assign_fakehost(struct userNode *user, const char *host, int announce); void set_geoip_info(struct userNode *user); -typedef void (*new_channel_func_t) (struct chanNode *chan); -void reg_new_channel_func(new_channel_func_t handler); -typedef int (*join_func_t) (struct modeNode *mNode); -void reg_join_func(join_func_t handler); +typedef void (*new_channel_func_t) (struct chanNode *chan, void *extra); +void reg_new_channel_func(new_channel_func_t handler, void *extra); +typedef int (*join_func_t) (struct modeNode *mNode, void *extra); +void reg_join_func(join_func_t handler, void *extra); typedef void (*del_channel_func_t) (struct chanNode *chan); void reg_del_channel_func(del_channel_func_t handler); @@ -413,8 +425,8 @@ void ChannelUserKicked(struct userNode* kicker, struct userNode* victim, struct int ChannelBanExists(struct chanNode *channel, const char *ban); int ChannelExemptExists(struct chanNode *channel, const char *exempt); -typedef int (*topic_func_t)(struct userNode *who, struct chanNode *chan, const char *old_topic); -void reg_topic_func(topic_func_t handler); +typedef int (*topic_func_t)(struct userNode *who, struct chanNode *chan, const char *old_topic, void *extra); +void reg_topic_func(topic_func_t handler, void *extra); void SetChannelTopic(struct chanNode *channel, struct userNode *service, struct userNode *user, const char *topic, int announce); struct userNode *IsInChannel(struct chanNode *channel, struct userNode *user);