X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/348683aa59f63ac110c129f808c91fc3156ee14f..ba4b4d51cca3e321dbb82384f00b9458e72e7639:/src/proto.h diff --git a/src/proto.h b/src/proto.h index 1d10bec..da55376 100644 --- a/src/proto.h +++ b/src/proto.h @@ -32,10 +32,6 @@ #define MAXNUMPARAMS 200 #define ALLCHANMSG_FUNCS_MAX 4 /* +1 == 5 potential 'allchanmsg' funcs */ -#ifdef HAVE_NETINET_IN_H -#include -#endif - struct gline; struct shun; struct server; @@ -98,19 +94,19 @@ char *client_report_privs(struct userNode *client); int check_priv(char *priv); /* Callback notifications for protocol support. */ -typedef void (*chanmsg_func_t) (struct userNode *user, struct chanNode *chan, char *text, struct userNode *bot); -void reg_chanmsg_func(unsigned char prefix, struct userNode *service, chanmsg_func_t handler); +typedef void (*chanmsg_func_t) (struct userNode *user, struct chanNode *chan, const char *text, struct userNode *bot, unsigned int is_notice, void *extra); +void reg_chanmsg_func(unsigned char prefix, struct userNode *service, chanmsg_func_t handler, void *extra); void reg_allchanmsg_func(struct userNode *service, chanmsg_func_t handler); struct userNode *get_chanmsg_bot(unsigned char prefix); -typedef void (*privmsg_func_t) (struct userNode *user, struct userNode *target, char *text, int server_qualified); +typedef void (*privmsg_func_t) (struct userNode *user, struct userNode *target, const char *text, int server_qualified); void reg_privmsg_func(struct userNode *user, privmsg_func_t handler); void reg_notice_func(struct userNode *user, privmsg_func_t handler); -void unreg_privmsg_func(struct userNode *user, privmsg_func_t handler); -void unreg_notice_func(struct userNode *user, privmsg_func_t handler); +void unreg_privmsg_func(struct userNode *user); +void unreg_notice_func(struct userNode *user); -typedef void (*oper_func_t) (struct userNode *user); -void reg_oper_func(oper_func_t handler); +typedef void (*oper_func_t) (struct userNode *user, void *extra); +void reg_oper_func(oper_func_t handler, void *extra); /* replay silliness */ void replay_read_line(void); @@ -130,6 +126,7 @@ void irc_connect(struct userNode *user, char *server, unsigned int port, struct /* messages */ void irc_privmsg(struct userNode *from, const char *to, const char *message); +void irc_privmsg_user(struct userNode *from, struct userNode *to, const char *message); void irc_notice(struct userNode *from, const char *to, const char *message); void irc_notice_user(struct userNode *from, struct userNode *to, const char *message); void irc_version_user(struct userNode *from, struct userNode *to); @@ -147,6 +144,7 @@ void irc_topic(struct userNode *service, struct userNode *who, struct chanNode * void irc_fetchtopic(struct userNode *from, const char *to); void irc_svsjoin(struct userNode *from, struct userNode *who, struct chanNode *to); void irc_svspart(struct userNode *from, struct userNode *who, struct chanNode *to); +void irc_svsquit(struct userNode *from, struct userNode *who, char const *reason); /* network maintenance */ void irc_silence(struct userNode *who, const char *mask, int add); @@ -162,6 +160,7 @@ void irc_stats(struct userNode *from, struct server *target, char type); void irc_svsnick(struct userNode *from, struct userNode *target, const char *newnick); void irc_swhois(struct userNode *from, struct userNode *target, const char *message); void irc_privs(struct userNode *target, char *flag, int add); +void irc_raw_privs(struct userNode *target, const char *privs); /* account maintenance */ void irc_rename(struct userNode *user, const char *new_handle); @@ -170,6 +169,7 @@ void irc_account(struct userNode *user, const char *stamp, time_t timestamp); void irc_regnick(struct userNode *user); void irc_fakehost(struct userNode *user, const char *host); void irc_mark(struct userNode *user, char *mark); +void irc_sno(unsigned int mask, char const* format, ...); /* numeric messages */ void irc_numeric(struct userNode *user, unsigned int num, const char *format, ...); @@ -177,17 +177,21 @@ void irc_numeric(struct userNode *user, unsigned int num, const char *format, .. #define RPL_ENDOFSTATS 219 #define RPL_STATSUPTIME 242 #define RPL_MAXCONNECTIONS 250 +#define RPL_AWAY 301 #define RPL_WHOISUSER 311 #define RPL_WHOISSERVER 312 #define RPL_WHOISOPERATOR 313 +#define RPL_WHOISIDLE 317 #define RPL_ENDOFWHOIS 318 +#define RPL_WHOISCHANNELS 319 +#define RPL_WHOISACCOUNT 330 +#define RPL_WHOISACTUALLY 338 #define ERR_NOSUCHNICK 401 /* stuff originally from other headers that is really protocol-specific */ int IsChannelName(const char *name); int is_valid_nick(const char *nick); -struct userNode *AddService(const char *nick, const char *modes, const char *desc, const char *hostname); -struct userNode *AddClone(const char *nick, const char *ident, const char *hostname, const char *desc); +struct userNode *AddLocalUser(const char *nick, const char *ident, const char *hostname, const char *desc, const char *modes); struct server* AddServer(struct server* uplink, const char *name, int hops, time_t boot, time_t link, const char *numeric, const char *description); void DelServer(struct server* serv, int announce, const char *message); void DelUser(struct userNode* user, struct userNode *killer, int announce, const char *why); @@ -195,6 +199,8 @@ void DelUser(struct userNode* user, struct userNode *killer, int announce, const /* User modes */ void mod_usermode(struct userNode *user, const char *modes); +extern const char irc_user_mode_chars[]; +unsigned int irc_user_modes(const struct userNode *user, char modes[], size_t length); /* Channel mode manipulation */ #define KEYLEN 23 @@ -246,6 +252,7 @@ int mod_chanmode(struct userNode *who, struct chanNode *channel, char **modes, u typedef void (*mode_change_func_t) (struct chanNode *channel, struct userNode *user, const struct mod_chanmode *change); void reg_mode_change_func(mode_change_func_t handler); int irc_make_chanmode(struct chanNode *chan, char *out); +int client_modify_priv_by_name(struct userNode *who, char *priv, int what); /* The "default" for generate_hostmask is to have all of these options off. */ #define GENMASK_STRICT_HOST 1