about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2009-01-18 00:12:28 +0100
committerFlorian Westphal <fw@strlen.de>2009-01-18 00:20:38 +0100
commit95e8320ca99eb9546102d10a329d708458257c56 (patch)
treeca53808872e837a072e0e92fd63e65aa1df59a7f /src
parent8f46681bc86162936ffdf56d7f534221ba20fbf5 (diff)
downloadngircd-95e8320ca99eb9546102d10a329d708458257c56.tar.gz
ngircd-95e8320ca99eb9546102d10a329d708458257c56.zip
irc.c: Fix handling of channels containing dots
commit 2546a13ad2949192eb70bf21e114ec60af287ee4
('Cumulative Message Patch') broke PRIVMSG to channels
containing dots.

Fix this by switching evaluation order:
Check first if the target matches a existing channel and only do a check
for target masks if that failed.

PRIVMSG with host/server masks is described in RFC 2812, section 3.3.1.

Makes one wonder how a server is _really_ supposed to tell the difference
between hostmasks and channel names.

Sigh.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/irc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c
index 47f86528..e5f5bbd5 100644
--- a/src/ngircd/irc.c
+++ b/src/ngircd/irc.c
@@ -467,18 +467,18 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
 						      Req->argv[1]))
 				return DISCONNECTED;
 		} else if (ForceType != CLIENT_SERVICE
+			   && (chan = Channel_Search(currentTarget))) {
+			/* channel */
+			if (!Channel_Write(chan, from, Client, Req->command,
+					   SendErrors, Req->argv[1]))
+					return DISCONNECTED;
+		} else if (ForceType != CLIENT_SERVICE
 			   && strchr("$#", currentTarget[0])
 			   && strchr(currentTarget, '.')) {
 			/* targetmask */
 			if (!Send_Message_Mask(from, Req->command, currentTarget,
 					       Req->argv[1], SendErrors))
 				return DISCONNECTED;
-		} else if (ForceType != CLIENT_SERVICE
-			   && (chan = Channel_Search(currentTarget))) {
-			/* channel */
-			if (!Channel_Write(chan, from, Client, Req->command,
-					   SendErrors, Req->argv[1]))
-					return DISCONNECTED;
 		} else {
 			if (!SendErrors)
 				return CONNECTED;