1 diff --git a/src/core/servers.c b/src/core/servers.c
2 index 30fc684..83733d0 100644
3 --- a/src/core/servers.c
4 +++ b/src/core/servers.c
5 @@ -783,3 +783,53 @@ void servers_deinit(void)
6 module_uniq_destroy("SERVER");
7 module_uniq_destroy("SERVER CONNECT");
10 +int server_connection_set_key(SERVER_REC *server, char *key, char *value)
12 + if (strcmp(key, "password") == 0) {
13 + g_free_not_null(server->connrec->password);
14 + server->connrec->password = g_strdup(value);
16 + if (strcmp(key, "nick") == 0) {
17 + g_free_not_null(server->connrec->nick);
18 + server->connrec->nick = g_strdup(value);
20 + else if (strcmp(key, "username") == 0) {
21 + g_free_not_null(server->connrec->username);
22 + server->connrec->username = g_strdup(value);
24 + else if (strcmp(key, "realname") == 0) {
25 + g_free_not_null(server->connrec->realname);
26 + server->connrec->realname = g_strdup(value);
28 + else if (strcmp(key, "tls_cert") == 0) {
29 + g_free_not_null(server->connrec->tls_cert);
30 + server->connrec->tls_cert = g_strdup(value);
32 + else if (strcmp(key, "tls_pkey") == 0) {
33 + g_free_not_null(server->connrec->tls_pkey);
34 + server->connrec->tls_pkey = g_strdup(value);
36 + else if (strcmp(key, "tls_cafile") == 0) {
37 + g_free_not_null(server->connrec->tls_cafile);
38 + server->connrec->tls_cafile = g_strdup(value);
40 + else if (strcmp(key, "tls_capath") == 0) {
41 + g_free_not_null(server->connrec->tls_capath);
42 + server->connrec->tls_capath = g_strdup(value);
44 + else if (strcmp(key, "use_tls") == 0) {
45 + server->connrec->use_tls = (strcmp(value, "no") != 0);
47 + else if (strcmp(key, "tls_verify") == 0) {
48 + server->connrec->tls_verify = (strcmp(value, "no") != 0);
50 + else if (strcmp(key, "resolve_prefer_ipv6") == 0) {
51 + server->connrec->family = (strcmp(value, "no") != 0);
59 diff --git a/src/perl/common/Server.xs b/src/perl/common/Server.xs
60 index 60878a6..1b6d6d1 100644
61 --- a/src/perl/common/Server.xs
62 +++ b/src/perl/common/Server.xs
63 @@ -103,6 +103,12 @@ send_message(server, target, msg, target_type)
65 server->send_message(server, target, msg, target_type);
68 +server_connection_set_key(server, key, value)
69 + Irssi::Server server
74 server_meta_stash(server, meta_key, meta_value)