diff options
| author | Alexander Barton <alex@barton.de> | 2008-08-16 18:26:19 +0200 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2008-09-23 11:53:15 +0200 |
| commit | 71e9ac486f1bdbe7e14adc20969c065f6bbeafe4 (patch) | |
| tree | edf2e0d1cdf67b87e5027bde11c57e4d5932ff2a /src | |
| parent | d93030ad27af9cd6a807de8f672ae73ec0e1dff8 (diff) | |
| download | ngircd-71e9ac486f1bdbe7e14adc20969c065f6bbeafe4.tar.gz ngircd-71e9ac486f1bdbe7e14adc20969c065f6bbeafe4.zip | |
Fix PRIVMSG/NOTICE handler Send_Message(): don't forward NOTICE as PRIVMSG.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ngircd/irc.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c index 0741aefa..3a2a9aff 100644 --- a/src/ngircd/irc.c +++ b/src/ngircd/irc.c @@ -39,8 +39,11 @@ static char UNUSED id[] = "$Id: irc.c,v 1.132 2008/01/15 22:28:14 fw Exp $"; static char *Option_String PARAMS((CONN_ID Idx)); -static bool Send_Message PARAMS((CLIENT *Client, REQUEST *Req, int ForceType, bool SendErrors)); -static bool Send_Message_Mask PARAMS((CLIENT *from, char *targetMask, char *message, bool SendErrors)); +static bool Send_Message PARAMS((CLIENT *Client, REQUEST *Req, int ForceType, + bool SendErrors)); +static bool Send_Message_Mask PARAMS((CLIENT *from, char *command, + char *targetMask, char *message, + bool SendErrors)); GLOBAL bool @@ -445,13 +448,14 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors) if (Client_Conn(from) > NONE) { Conn_UpdateIdle(Client_Conn(from)); } - if (!IRC_WriteStrClientPrefix(cl, from, "PRIVMSG %s :%s", - Client_ID(cl), Req->argv[1])) + if (!IRC_WriteStrClientPrefix(cl, from, "%s %s :%s", + Req->command, Client_ID(cl), + Req->argv[1])) return DISCONNECTED; } else if (strchr("$#", currentTarget[0]) && strchr(currentTarget, '.')) { /* targetmask */ - if (!Send_Message_Mask(from, currentTarget, + if (!Send_Message_Mask(from, Req->command, currentTarget, Req->argv[1], SendErrors)) return DISCONNECTED; } else if ((chan = Channel_Search(currentTarget))) { @@ -474,7 +478,8 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors) static bool -Send_Message_Mask(CLIENT * from, char * targetMask, char * message, bool SendErrors) +Send_Message_Mask(CLIENT * from, char * command, char * targetMask, + char * message, bool SendErrors) { CLIENT *cl; bool client_match; @@ -495,8 +500,8 @@ Send_Message_Mask(CLIENT * from, char * targetMask, char * message, bool SendErr continue; client_match = MatchCaseInsensitive(mask, Client_Hostname(cl)); if (client_match) - if (!IRC_WriteStrClientPrefix(cl, from, "PRIVMSG %s :%s", - Client_ID(cl), message)) + if (!IRC_WriteStrClientPrefix(cl, from, "%s %s :%s", + command, Client_ID(cl), message)) return false; } } else { @@ -506,8 +511,8 @@ Send_Message_Mask(CLIENT * from, char * targetMask, char * message, bool SendErr client_match = MatchCaseInsensitive(mask, Client_ID(Client_Introducer(cl))); if (client_match) - if (!IRC_WriteStrClientPrefix(cl, from, "PRIVMSG %s :%s", - Client_ID(cl), message)) + if (!IRC_WriteStrClientPrefix(cl, from, "%s %s :%s", + command, Client_ID(cl), message)) return false; } } |