mirror of
https://github.com/osmarks/ngircd.git
synced 2025-07-06 03:42:49 +00:00
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.
This commit is contained in:
parent
8f46681bc8
commit
95e8320ca9
@ -466,6 +466,12 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
|
|||||||
Req->command, Client_ID(cl),
|
Req->command, Client_ID(cl),
|
||||||
Req->argv[1]))
|
Req->argv[1]))
|
||||||
return DISCONNECTED;
|
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
|
} else if (ForceType != CLIENT_SERVICE
|
||||||
&& strchr("$#", currentTarget[0])
|
&& strchr("$#", currentTarget[0])
|
||||||
&& strchr(currentTarget, '.')) {
|
&& strchr(currentTarget, '.')) {
|
||||||
@ -473,12 +479,6 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
|
|||||||
if (!Send_Message_Mask(from, Req->command, currentTarget,
|
if (!Send_Message_Mask(from, Req->command, currentTarget,
|
||||||
Req->argv[1], SendErrors))
|
Req->argv[1], SendErrors))
|
||||||
return DISCONNECTED;
|
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 {
|
} else {
|
||||||
if (!SendErrors)
|
if (!SendErrors)
|
||||||
return CONNECTED;
|
return CONNECTED;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user