2000-08-26 15:39:44 +00:00
|
|
|
/* SERVER_REC definition, used for inheritance */
|
|
|
|
|
|
2000-09-01 00:26:46 +00:00
|
|
|
int type; /* module_get_uniq_id("SERVER", 0) */
|
|
|
|
|
int chat_type; /* chat_protocol_lookup(xx) */
|
2000-08-26 15:39:44 +00:00
|
|
|
|
2001-12-14 01:54:12 +00:00
|
|
|
int refcount;
|
|
|
|
|
|
2000-08-26 15:39:44 +00: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 */
|
|
|
|
|
|
2001-12-14 01:54:12 +00:00
|
|
|
unsigned int connected:1; /* Connected to server */
|
|
|
|
|
unsigned int disconnected:1; /* Disconnected, waiting for refcount to drop zero */
|
2000-11-23 21:40:07 +00:00
|
|
|
unsigned int connection_lost:1; /* Connection lost unintentionally */
|
2001-11-19 01:48:58 +00:00
|
|
|
unsigned int session_reconnect:1; /* Connected to this server with /UPGRADE */
|
2001-12-06 23:05:54 +00:00
|
|
|
unsigned int no_reconnect:1; /* Don't reconnect to server */
|
2000-08-26 15:39:44 +00:00
|
|
|
|
2001-01-01 07:45:54 +00:00
|
|
|
NET_SENDBUF_REC *handle;
|
2000-08-26 15:39:44 +00:00
|
|
|
int readtag; /* input tag */
|
|
|
|
|
|
2019-02-18 11:39:45 -08:00
|
|
|
/* for net_gethostbyname_return() */
|
2000-12-04 22:57:18 +00:00
|
|
|
GIOChannel *connect_pipe[2];
|
2000-08-26 15:39:44 +00:00
|
|
|
int connect_tag;
|
|
|
|
|
int connect_pid;
|
|
|
|
|
|
2001-01-01 07:45:54 +00:00
|
|
|
RAWLOG_REC *rawlog;
|
2000-08-26 15:39:44 +00:00
|
|
|
GHashTable *module_data;
|
|
|
|
|
|
|
|
|
|
char *version; /* server version */
|
|
|
|
|
char *away_reason;
|
2000-09-30 22:49:48 +00:00
|
|
|
char *last_invite; /* channel where you were last invited */
|
2000-11-23 21:40:07 +00: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 23:57:19 +00:00
|
|
|
unsigned int dns_error:1; /* DNS said the host doesn't exist */
|
2000-08-26 15:39:44 +00:00
|
|
|
|
2019-12-06 10:56:25 +01:00
|
|
|
gint64 lag_sent; /* 0 or time when last lag query was sent to server */
|
2000-09-06 21:30:56 +00:00
|
|
|
time_t lag_last_check; /* last time we checked lag */
|
|
|
|
|
int lag; /* server lag in milliseconds */
|
|
|
|
|
|
2000-08-26 15:39:44 +00:00
|
|
|
GSList *channels;
|
|
|
|
|
GSList *queries;
|
|
|
|
|
|
2000-09-30 22:49:48 +00: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 07:45:54 +00:00
|
|
|
void (*channels_join)(SERVER_REC *server, const char *data, int automatic);
|
2000-09-30 22:49:48 +00:00
|
|
|
/* returns true if `flag' indicates a nick flag (op/voice/halfop) */
|
2004-01-20 10:57:57 +00:00
|
|
|
int (*isnickflag)(SERVER_REC *server, char flag);
|
2001-01-01 16:57:25 +00:00
|
|
|
/* returns true if `data' indicates a channel */
|
2001-11-01 22:52:23 +00:00
|
|
|
int (*ischannel)(SERVER_REC *server, const char *data);
|
2000-09-30 22:49:48 +00:00
|
|
|
/* returns all nick flag characters in order op, voice, halfop. If some
|
|
|
|
|
of them aren't supported '\0' can be used. */
|
2004-01-20 10:57:57 +00:00
|
|
|
const char *(*get_nick_flags)(SERVER_REC *server);
|
2000-09-30 22:49:48 +00:00
|
|
|
/* send public or private message to server */
|
2002-02-03 21:53:37 +00:00
|
|
|
void (*send_message)(SERVER_REC *server, const char *target,
|
|
|
|
|
const char *msg, int target_type);
|
2014-06-13 06:39:02 +02:00
|
|
|
/* split message in case it is too long for the server to receive */
|
|
|
|
|
char **(*split_message)(SERVER_REC *server, const char *target,
|
|
|
|
|
const char *msg);
|
2000-09-30 22:49:48 +00:00
|
|
|
|
|
|
|
|
/* -- Default implementations are used if NULL -- */
|
2001-01-01 07:45:54 +00: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 22:49:48 +00: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 15:39:44 +00:00
|
|
|
|
|
|
|
|
#undef STRUCT_SERVER_CONNECT_REC
|