summary refs log tree commit diff stats
path: root/src/common/inbound.c
diff options
context:
space:
mode:
authorDerp Derpingston <rjs3275@g.rit.edu>2014-05-11 06:29:38 -0700
committerTingPing <tingping@tingping.se>2014-05-12 04:55:45 -0400
commit7435572282b4ef6ea2487442ef4d34984d28d9c2 (patch)
tree9e36b5eb8567d8af2644269d4a6b7ce3797ab37a /src/common/inbound.c
parent17671ec69442cfd3a421720ef78b504e3652bc16 (diff)
Properly support notices to prefix'd users on a channel
Instead of hardcoding this behavior for @, +, and %, fetch the list of
mode prefixes from the server's state and look for one of those instead.

Closes #977
Diffstat (limited to 'src/common/inbound.c')
-rw-r--r--src/common/inbound.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/common/inbound.c b/src/common/inbound.c
index 401e9562..b80553b3 100644
--- a/src/common/inbound.c
+++ b/src/common/inbound.c
@@ -948,19 +948,8 @@ inbound_notice (server *serv, char *to, char *nick, char *msg, char *ip, int id,
 	if (is_channel (serv, ptr))
 		sess = find_channel (serv, ptr);
 
-	if (!sess && ptr[0] == '@')
-	{
-		ptr++;
-		sess = find_channel (serv, ptr);
-	}
-
-	if (!sess && ptr[0] == '%')
-	{
-		ptr++;
-		sess = find_channel (serv, ptr);
-	}
-
-	if (!sess && ptr[0] == '+')
+	/* /notice [mode-prefix]#channel should end up in that channel */
+	if (!sess && strchr(serv->nick_prefixes, ptr[0]) != NULL)
 	{
 		ptr++;
 		sess = find_channel (serv, ptr);