Now inbound_cap_ls() can enable extensions when a bouncer uses a namespace for the...
[rofl0r-ixchat.git] / src / common / servlist.h
blob85daa312d5262ed58171899bb7ae48bc289d230d
1 #ifndef XCHAT_SERVLIST_H
2 #define XCHAT_SERVLIST_H
4 typedef struct ircserver
6 char *hostname;
7 } ircserver;
9 typedef struct ircnet
11 char *name;
12 char *nick;
13 char *nick2;
14 char *user;
15 char *real;
16 char *pass;
17 char *autojoin;
18 char *command;
19 int logintype;
20 char *comment;
21 char *encoding;
22 GSList *servlist;
23 int selected;
24 guint32 flags;
25 } ircnet;
27 extern GSList *network_list;
29 #define FLAG_CYCLE 1
30 #define FLAG_USE_GLOBAL 2
31 #define FLAG_USE_SSL 4
32 #define FLAG_AUTO_CONNECT 8
33 #define FLAG_USE_PROXY 16
34 #define FLAG_ALLOW_INVALID 32
35 #define FLAG_FAVORITE 64
36 #define FLAG_COUNT 7
38 /* Login methods. Use server password by default - if we had a NickServ password, it'd be set to 2 already by servlist_load() */
39 #define LOGIN_DEFAULT_REAL LOGIN_PASS /* this is to set the default login method for unknown servers */
40 #define LOGIN_DEFAULT 0 /* this is for the login type dropdown, doesn't serve any other purpose */
41 #define LOGIN_MSG_NICKSERV 1
42 #define LOGIN_NICKSERV 2
43 #if 0
44 #define LOGIN_NS 3
45 #define LOGIN_MSG_NS 4
46 #define LOGIN_AUTH 5
47 #endif
48 #define LOGIN_SASL 6
49 #define LOGIN_PASS 7
50 #define LOGIN_CHALLENGEAUTH 8
51 #define LOGIN_CUSTOM 9
53 #define CHALLENGEAUTH_ALGO "HMAC-SHA-256"
54 #define CHALLENGEAUTH_NICK "Q@CServe.quakenet.org"
56 void servlist_init (void);
57 int servlist_save (void);
58 int servlist_cycle (server *serv);
59 void servlist_connect (session *sess, ircnet *net, gboolean join);
60 int servlist_connect_by_netname (session *sess, char *network, gboolean join);
61 int servlist_auto_connect (session *sess);
62 int servlist_have_auto (void);
63 int servlist_check_encoding (char *charset);
64 void servlist_cleanup (void);
66 ircnet *servlist_net_add (char *name, char *comment, int prepend);
67 void servlist_net_remove (ircnet *net);
68 ircnet *servlist_net_find (char *name, int *pos, int (*cmpfunc) (const char *, const char *));
69 ircnet *servlist_net_find_from_server (char *server_name);
71 void servlist_server_remove (ircnet *net, ircserver *serv);
72 ircserver *servlist_server_add (ircnet *net, char *name);
73 ircserver *servlist_server_find (ircnet *net, char *name, int *pos);
75 void joinlist_split (char *autojoin, GSList **channels, GSList **keys);
76 gboolean joinlist_is_in_list (server *serv, char *channel);
77 void joinlist_free (GSList *channels, GSList *keys);
78 gchar *joinlist_merge (GSList *channels, GSList *keys);
80 #endif