summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTingPing <TingPing@users.noreply.github.com>2013-09-23 14:58:11 -0400
committerTingPing <TingPing@users.noreply.github.com>2013-09-23 14:58:11 -0400
commit0146a38faa9ae6997f2bcbe02fa9af378a9cc715 (patch)
treec42fef28899493a8f9b2c40c6e1b2eb36d3b09d8
parent145ceba1240792f2488dea6cec83f295b6a7e591 (diff)
Fix url detection of channel with nick prefix
Closes #769
-rw-r--r--src/common/url.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/common/url.c b/src/common/url.c
index 57d8d88b..0df78f78 100644
--- a/src/common/url.c
+++ b/src/common/url.c
@@ -266,11 +266,20 @@ match_channel (const char *word, int *start, int *end)
 {
 	const server *serv = current_sess->server;
 	const char *chan_prefixes = serv ? serv->chantypes : CHANPRE;
+	const char *nick_prefixes = serv ? serv->nick_prefixes : NICKPRE;
 
 	if (!regex_match (re_channel (), word, start, end))
 		return FALSE;
 
-	return strchr (chan_prefixes, word[*start]) != NULL;
+	/* Check for +#channel (for example whois output) */
+	if (strchr (nick_prefixes, word[*start]) != NULL
+		 && strchr (chan_prefixes, word[*start + 1]) != NULL)
+		return TRUE;
+	/* Or just #channel */
+	else if (strchr (chan_prefixes, word[*start]) != NULL)
+		return TRUE;
+	
+	return FALSE;
 }
 
 static gboolean