diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/inbound.c | 14 | ||||
-rw-r--r-- | src/common/outbound.c | 34 | ||||
-rw-r--r-- | src/common/url.c | 4 | ||||
-rw-r--r-- | src/fe-gtk/xtext.c | 9 | ||||
-rw-r--r-- | src/htm/Main.cs | 2 |
5 files changed, 41 insertions, 22 deletions
diff --git a/src/common/inbound.c b/src/common/inbound.c index c04d0187..898dcf4b 100644 --- a/src/common/inbound.c +++ b/src/common/inbound.c @@ -1034,6 +1034,7 @@ check_autojoin_channels (server *serv) free (serv->autojoin); serv->autojoin = NULL; + i++; } /* this is really only for re-connects when you @@ -1057,8 +1058,17 @@ check_autojoin_channels (server *serv) if (po) *po = 0; - channels = g_slist_append (channels, g_strdup (sess->waitchannel)); - keys = g_slist_append (keys, g_strdup (sess->channelkey)); + /* There can be no gap between keys, list keyed chans first. */ + if (sess->channelkey[0] != 0) + { + channels = g_slist_prepend (channels, g_strdup (sess->waitchannel)); + keys = g_slist_prepend (keys, g_strdup (sess->channelkey)); + } + else + { + channels = g_slist_append (channels, g_strdup (sess->waitchannel)); + keys = g_slist_append (keys, g_strdup (sess->channelkey)); + } i++; } } diff --git a/src/common/outbound.c b/src/common/outbound.c index c146c2ac..e073ca1d 100644 --- a/src/common/outbound.c +++ b/src/common/outbound.c @@ -2873,7 +2873,7 @@ open_query (server *serv, char *nick, gboolean focus_existing) sess = find_dialog (serv, nick); if (!sess) - new_ircwindow (serv, nick, SESS_DIALOG, 1); + new_ircwindow (serv, nick, SESS_DIALOG, focus_existing); else if (focus_existing) fe_ctrl_gui (sess, 2, 0); /* bring-to-front */ } @@ -3066,7 +3066,7 @@ cmd_splay (struct session *sess, char *tbuf, char *word[], char *word_eol[]) } static int -parse_irc_url (char *url, char *server_name[], char *port[], char *channel[], int *use_ssl) +parse_irc_url (char *url, char *server_name[], char *port[], char *channel[], char *key[], int *use_ssl) { char *co; #ifdef USE_OPENSSL @@ -3104,6 +3104,15 @@ urlserv: *channel = co; } + /* check for key - mirc style */ + co = strchr (co + 1, '?'); + if (co) + { + *co = 0; + co++; + *key = co; + } + return TRUE; } return FALSE; @@ -3117,6 +3126,7 @@ cmd_server (struct session *sess, char *tbuf, char *word[], char *word_eol[]) char *port = NULL; char *pass = NULL; char *channel = NULL; + char *key = NULL; int use_ssl = FALSE; int is_url = TRUE; server *serv = sess->server; @@ -3130,7 +3140,7 @@ cmd_server (struct session *sess, char *tbuf, char *word[], char *word_eol[]) } #endif - if (!parse_irc_url (word[2 + offset], &server_name, &port, &channel, &use_ssl)) + if (!parse_irc_url (word[2 + offset], &server_name, &port, &channel, &key, &use_ssl)) { is_url = FALSE; server_name = word[2 + offset]; @@ -3156,6 +3166,8 @@ cmd_server (struct session *sess, char *tbuf, char *word[], char *word_eol[]) { sess->willjoinchannel[0] = '#'; safe_strcpy ((sess->willjoinchannel + 1), channel, (CHANLEN - 1)); + if (key) + safe_strcpy (sess->channelkey, key, 64); } /* support +7000 style ports like mIRC */ @@ -3356,15 +3368,18 @@ find_server_from_net (void *net) } static void -url_join_only (server *serv, char *tbuf, char *channel) +url_join_only (server *serv, char *tbuf, char *channel, char *key) { - /* already connected, JOIN only. FIXME: support keys? */ + /* already connected, JOIN only. */ if (channel == NULL) return; tbuf[0] = '#'; /* tbuf is 4kb */ safe_strcpy ((tbuf + 1), channel, 256); - serv->p_join (serv, tbuf, ""); + if (key) + serv->p_join (serv, tbuf, key); + else + serv->p_join (serv, tbuf, ""); } static int @@ -3375,12 +3390,13 @@ cmd_url (struct session *sess, char *tbuf, char *word[], char *word_eol[]) char *server_name = NULL; char *port = NULL; char *channel = NULL; + char *key = NULL; char *url = g_strdup (word[2]); int use_ssl = FALSE; void *net; server *serv; - if (parse_irc_url (url, &server_name, &port, &channel, &use_ssl)) + if (parse_irc_url (url, &server_name, &port, &channel, &key, &use_ssl)) { /* maybe we're already connected to this net */ @@ -3396,7 +3412,7 @@ cmd_url (struct session *sess, char *tbuf, char *word[], char *word_eol[]) serv = find_server_from_net (net); if (serv) { - url_join_only (serv, tbuf, channel); + url_join_only (serv, tbuf, channel, key); g_free (url); return TRUE; } @@ -3407,7 +3423,7 @@ cmd_url (struct session *sess, char *tbuf, char *word[], char *word_eol[]) serv = find_server_from_hostname (server_name); if (serv) { - url_join_only (serv, tbuf, channel); + url_join_only (serv, tbuf, channel, key); g_free (url); return TRUE; } diff --git a/src/common/url.c b/src/common/url.c index 6bd7d9ff..2007b600 100644 --- a/src/common/url.c +++ b/src/common/url.c @@ -515,8 +515,8 @@ re_channel (void) /* PATH description --- */ #ifdef WIN32 -/* Windows path can be C: D: etc */ -#define PATH "^([a-z]:).*" +/* Windows path can be .\ ..\ or C: D: etc */ +#define PATH "^(\\.{1,2}\\\\|[a-z]:).*" #else /* Linux path can be / or ./ or ../ etc */ #define PATH "^(/|\\./|\\.\\./).*" diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c index 6005e265..5b85022e 100644 --- a/src/fe-gtk/xtext.c +++ b/src/fe-gtk/xtext.c @@ -90,15 +90,8 @@ #endif /* is delimiter */ -#if 0 -/* () is used by Wikipedia */ -#define is_del(c) \ - (c == ' ' || c == '\n' || c == ')' || c == '(' || \ - c == '>' || c == '<' || c == ATTR_RESET || c == ATTR_BOLD || c == 0) -#endif #define is_del(c) \ - (c == ' ' || c == '\n' || c == '>' || c == '<' || \ - c == ATTR_RESET || c == ATTR_BOLD || c == 0) + (c == ' ' || c == '\n' || c == '>' || c == '<' || c == 0) #ifdef SCROLL_HACK /* force scrolling off */ diff --git a/src/htm/Main.cs b/src/htm/Main.cs index cc33e206..e3ae04cf 100644 --- a/src/htm/Main.cs +++ b/src/htm/Main.cs @@ -281,7 +281,7 @@ namespace thememan try { - using (Package zip = Package.Open(zipFile.FullName, FileMode.Open)) + using (Package zip = Package.Open(zipFile.FullName, FileMode.Open, FileAccess.Read)) { PackagePartCollection parts = zip.GetParts(); |