use starttls

This commit is contained in:
ailin-nemui 2020-04-05 13:18:54 +02:00 committed by Ailin Nemui
commit 51508ff1d3
13 changed files with 324 additions and 116 deletions

View file

@ -27,6 +27,7 @@
#define CAP_ACCOUNT_NOTIFY "account-notify"
#define CAP_SELF_MESSAGE "znc.in/self-message"
#define CAP_SERVER_TIME "server-time"
#define CAP_STARTTLS "tls"
/* returns IRC_SERVER_REC if it's IRC server, NULL if it isn't */
#define IRC_SERVER(server) \
@ -42,6 +43,7 @@
#define IS_IRC_SERVER_CONNECT(conn) \
(IRC_SERVER_CONNECT(conn) ? TRUE : FALSE)
/* clang-format off */
/* all strings should be either NULL or dynamically allocated */
/* address and nick are mandatory, rest are optional */
struct _IRC_SERVER_CONNECT_REC {
@ -59,7 +61,10 @@ struct _IRC_SERVER_CONNECT_REC {
int max_query_chans;
int max_kicks, max_msgs, max_modes, max_whois;
int no_starttls:1;
int starttls:1;
};
/* clang-format on */
#define STRUCT_SERVER_CONNECT_REC IRC_SERVER_CONNECT_REC
struct _IRC_SERVER_REC {
@ -136,6 +141,7 @@ struct _IRC_SERVER_REC {
GSList *rejoin_channels; /* try to join to these channels after a while -
channels go here if they're "temporarily unavailable"
because of netsplits */
guint starttls_tag; /* Holds the source id of the running timeout */
struct _SERVER_QUERY_REC *chanqueries;
GHashTable *isupport;
@ -155,6 +161,7 @@ void irc_server_purge_output(IRC_SERVER_REC *server, const char *target);
like "#a,#b,#c,#d x,b_chan_key,x,x" or just "#e,#f,#g" */
char *irc_server_get_channels(IRC_SERVER_REC *server);
void irc_server_send_starttls(IRC_SERVER_REC *server);
/* INTERNAL: */
void irc_server_send_action(IRC_SERVER_REC *server, const char *target,
const char *data);