2000-08-26 11:39:44 -04:00
|
|
|
/* SERVER_REC definition, used for inheritance */
|
|
|
|
|
2000-08-31 20:26:46 -04:00
|
|
|
int type; /* module_get_uniq_id("SERVER", 0) */
|
|
|
|
int chat_type; /* chat_protocol_lookup(xx) */
|
2000-08-26 11:39:44 -04:00
|
|
|
|
|
|
|
STRUCT_SERVER_CONNECT_REC *connrec;
|
|
|
|
time_t connect_time; /* connection time */
|
|
|
|
time_t real_connect_time; /* time when server replied that we really are connected */
|
|
|
|
|
|
|
|
char *tag; /* tag name for addressing server */
|
|
|
|
char *nick; /* current nick */
|
|
|
|
|
2000-11-23 16:40:07 -05:00
|
|
|
unsigned int connected:1; /* connected to server */
|
|
|
|
unsigned int connection_lost:1; /* Connection lost unintentionally */
|
2001-11-18 20:48:58 -05:00
|
|
|
unsigned int session_reconnect:1; /* Connected to this server with /UPGRADE */
|
2000-08-26 11:39:44 -04:00
|
|
|
|
2001-01-01 02:45:54 -05:00
|
|
|
NET_SENDBUF_REC *handle;
|
2000-08-26 11:39:44 -04:00
|
|
|
int readtag; /* input tag */
|
|
|
|
|
|
|
|
/* for net_connect_nonblock() */
|
2000-12-04 17:57:18 -05:00
|
|
|
GIOChannel *connect_pipe[2];
|
2000-08-26 11:39:44 -04:00
|
|
|
int connect_tag;
|
|
|
|
int connect_pid;
|
|
|
|
|
2001-01-01 02:45:54 -05:00
|
|
|
RAWLOG_REC *rawlog;
|
|
|
|
LINEBUF_REC *buffer; /* receive buffer */
|
2000-08-26 11:39:44 -04:00
|
|
|
GHashTable *module_data;
|
|
|
|
|
|
|
|
char *version; /* server version */
|
|
|
|
char *away_reason;
|
2000-09-30 18:49:48 -04:00
|
|
|
char *last_invite; /* channel where you were last invited */
|
2000-11-23 16:40:07 -05:00
|
|
|
unsigned int server_operator:1;
|
|
|
|
unsigned int usermode_away:1;
|
|
|
|
unsigned int banned:1; /* not allowed to connect to this server */
|
2001-03-07 18:57:19 -05:00
|
|
|
unsigned int dns_error:1; /* DNS said the host doesn't exist */
|
2000-08-26 11:39:44 -04:00
|
|
|
|
2001-11-15 08:47:51 -05:00
|
|
|
GTimeVal lag_sent; /* 0 or time when last lag query was sent to server */
|
2000-09-06 17:30:56 -04:00
|
|
|
time_t lag_last_check; /* last time we checked lag */
|
|
|
|
int lag; /* server lag in milliseconds */
|
|
|
|
|
2000-08-26 11:39:44 -04:00
|
|
|
GSList *channels;
|
|
|
|
GSList *queries;
|
|
|
|
|
2000-09-30 18:49:48 -04:00
|
|
|
/* -- support for multiple server types -- */
|
|
|
|
|
|
|
|
/* -- must not be NULL: -- */
|
|
|
|
/* join to a number of channels, channels are specified in `data' separated
|
|
|
|
with commas. there can exist other information after first space like
|
|
|
|
channel keys etc. */
|
2001-01-01 02:45:54 -05:00
|
|
|
void (*channels_join)(SERVER_REC *server, const char *data, int automatic);
|
2000-09-30 18:49:48 -04:00
|
|
|
/* returns true if `flag' indicates a nick flag (op/voice/halfop) */
|
|
|
|
int (*isnickflag)(char flag);
|
2001-01-01 11:57:25 -05:00
|
|
|
/* returns true if `data' indicates a channel */
|
2001-11-01 17:52:23 -05:00
|
|
|
int (*ischannel)(SERVER_REC *server, const char *data);
|
2000-09-30 18:49:48 -04:00
|
|
|
/* returns all nick flag characters in order op, voice, halfop. If some
|
|
|
|
of them aren't supported '\0' can be used. */
|
|
|
|
const char *(*get_nick_flags)(void);
|
|
|
|
/* send public or private message to server */
|
2001-01-01 02:45:54 -05:00
|
|
|
void (*send_message)(SERVER_REC *server, const char *target, const char *msg);
|
2000-09-30 18:49:48 -04:00
|
|
|
|
|
|
|
/* -- Default implementations are used if NULL -- */
|
2001-01-01 02:45:54 -05:00
|
|
|
CHANNEL_REC *(*channel_find_func)(SERVER_REC *server, const char *name);
|
|
|
|
QUERY_REC *(*query_find_func)(SERVER_REC *server, const char *nick);
|
2000-09-30 18:49:48 -04:00
|
|
|
int (*mask_match_func)(const char *mask, const char *data);
|
|
|
|
/* returns true if `msg' was meant for `nick' */
|
|
|
|
int (*nick_match_msg)(const char *nick, const char *msg);
|
2000-08-26 11:39:44 -04:00
|
|
|
|
|
|
|
#undef STRUCT_SERVER_CONNECT_REC
|