diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/weechat.c | 5 | ||||
-rw-r--r-- | src/common/weechat.h | 2 | ||||
-rw-r--r-- | src/irc/irc-server.c | 31 |
3 files changed, 33 insertions, 5 deletions
diff --git a/src/common/weechat.c b/src/common/weechat.c index 28549a0d7..1a8db3385 100644 --- a/src/common/weechat.c +++ b/src/common/weechat.c @@ -364,7 +364,7 @@ wee_parse_args (int argc, char *argv[]) wee_display_commands (1, 0); wee_shutdown (EXIT_SUCCESS); } - else if ((strncasecmp (argv[i], "irc://", 6) == 0)) + else if ((strncasecmp (argv[i], "irc", 3) == 0)) { if (server_init_with_url (argv[i], &server_tmp) < 0) { @@ -376,7 +376,8 @@ wee_parse_args (int argc, char *argv[]) if (!server_new (server_tmp.name, server_tmp.autoconnect, server_tmp.autoreconnect, server_tmp.autoreconnect_delay, - 1, server_tmp.address, server_tmp.port, 0, 0, + 1, server_tmp.address, server_tmp.port, + server_tmp.ipv6, server_tmp.ssl, server_tmp.password, server_tmp.nick1, server_tmp.nick2, server_tmp.nick3, NULL, NULL, NULL, 0, server_tmp.autojoin, 1, NULL)) diff --git a/src/common/weechat.h b/src/common/weechat.h index 33160a52f..ead962144 100644 --- a/src/common/weechat.h +++ b/src/common/weechat.h @@ -86,7 +86,7 @@ PACKAGE_STRING " (c) Copyright 2003-2005, compiled on " __DATE__ " " __TIME__ \ "\nDeveloped by FlashCode <flashcode@flashtux.org> - " WEECHAT_WEBSITE "\n\n" \ "Usage: %s [options ...]\n" \ - " or: %s [irc://[nickname[:password]@]irc.example.org[:port][/channel] ...]\n\n" + " or: %s [irc[6][s]://[nickname[:password]@]irc.example.org[:port][/channel][,channel[...]]\n\n" #define WEE_USAGE2 \ " -c, --config display config file options\n" \ diff --git a/src/irc/irc-server.c b/src/irc/irc-server.c index 5ac4e314e..3c24e00cc 100644 --- a/src/irc/irc-server.c +++ b/src/irc/irc-server.c @@ -120,18 +120,42 @@ int server_init_with_url (char *irc_url, t_irc_server *server) { char *url, *pos_server, *pos_channel, *pos, *pos2; + int ipv6, ssl; struct passwd *my_passwd; server_init (server); - if (strncasecmp (irc_url, "irc://", 6) != 0) + ipv6 = 0; + ssl = 0; + if (strncasecmp (irc_url, "irc6://", 7) == 0) + { + pos = irc_url + 7; + ipv6 = 1; + } + else if (strncasecmp (irc_url, "ircs://", 7) == 0) + { + pos = irc_url + 7; + ssl = 1; + } + else if ((strncasecmp (irc_url, "irc6s://", 8) == 0) + || (strncasecmp (irc_url, "ircs6://", 8) == 0)) + { + pos = irc_url + 8; + ipv6 = 1; + ssl = 1; + } + else if (strncasecmp (irc_url, "irc://", 6) == 0) + { + pos = irc_url + 6; + } + else return -1; + url = strdup (irc_url); pos_server = strchr (url, '@'); if (pos_server) { pos_server[0] = '\0'; pos_server++; - pos = url + 6; if (!pos[0]) { free (url); @@ -193,6 +217,9 @@ server_init_with_url (char *irc_url, t_irc_server *server) free (url); + server->ipv6 = ipv6; + server->ssl = ssl; + /* some default values */ if (server->port < 0) server->port = DEFAULT_IRC_PORT; |