/* Copyright (C) 2003, 2004 IRCtoo Network, Pasi Hirvonen */ #ifndef _PSEUDOCLIENT_H_ #define _PSEUDOCLIENT_H_ /* type field flags */ #define PCLIENT_MASTER 0x001 #define PCLIENT_REGULAR 0x002 #define PCLIENT_CYCLER 0x008 #define PCLIENT_INTRODUCED 0x004 typedef struct { irc_user user; char *channels[MAXPSEUDOCHANS]; /* max channels per pseudo, USE THE DEFINES IN CODE */ unsigned int chanlistlen; /* free slots, for more straightforward handling */ unsigned int freechannels; /* see above */ int type; } pclient; /* introduce all known pseudoclients, e.g. send USER and SJOINs. */ void s_introduce_pseudoclients(void); void s_introduce_pseudoclient(gpointer, gpointer); pclient *s_find_pseudoclient(char *nick); void s_clean_pseudoclient(gpointer, gpointer); /* this is used to bring in the primary pseudoclient usually called * SpamServ (the one used to control everything) */ void s_add_controlbot(void); /* join and part the control chans */ void s_controlbot_add_chans(gboolean); void s_controlbot_del_chans(void); /* the function all spamserv "invitations" use. */ int s_invite_pseudoclient(char *, char *, irc_user *); /* the Correct Way to add a channel which pseudoclients monitor. * Will take care of finding a free slot etc. */ pclient *s_add_pseudochan_target(char *, char *); pclient *s_add_pseudochan(char *); /* delete a channel from pseudoclient's list */ int s_del_pseudochan(char *); /* call when you get a kick at channel */ void s_del_pseudochan_by_kick(char *nick, char *channel); /* list pseudoclient channels */ void s_list_pseudochans_to(irc_user *, char *); /* report pseudoclient at channel */ char *s_pseudo_at_chan(char *channel); /* this probably should be moved to the .c, shouldn't be called * directly. add_pseudochan takes care of calling this. */ pclient *s_add_pseudoclient(void); /* add cycler pseudo */ pclient *s_add_cycle_pseudo(pclient *p); /* free all pseudoclients, e.g. on quit */ void s_free_pseudoclients(void); /* cleanup is called when connection to server is lost. resets the * "introduced?" bits. */ void s_pseudoclient_cleanup(void); /* whois */ void s_pseudoclient_parse_whois(irc_user *, char *); /* return the number of pseudoclients */ unsigned long s_get_pseudocount(void); /* for forbid: */ int s_pseudochan_forbid(char *, char *); int s_pseudochan_unforbid(char *); void s_pseudochan_forbids_list_to(irc_user *user, char *mask); #endif /* _PSEUDOCLIENT_H_ */