diff options
| author | 2006-07-25 10:30:46 +0000 | |
|---|---|---|
| committer | 2006-07-25 10:30:46 +0000 | |
| commit | 3f3c60a3df68260bd82efa2fc00a1fbd6bb7d54e (patch) | |
| tree | d8ca47978d07ba35926c5c8a80ac2a1af1a09292 /src/cmd_privmsg.cpp | |
| parent | Fix NOTICE $* to go between servers (diff) | |
Allow PRIVMSG and NOTICE targets of $<servermask> to the module events (this wasnt trivial and is almost a damn feature)
git-svn-id: http://svn.inspircd.org/repository/branches/1_0_stable@4538 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/cmd_privmsg.cpp')
| -rw-r--r-- | src/cmd_privmsg.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/cmd_privmsg.cpp b/src/cmd_privmsg.cpp index bf962f27e..f4938fae3 100644 --- a/src/cmd_privmsg.cpp +++ b/src/cmd_privmsg.cpp @@ -68,14 +68,20 @@ void cmd_privmsg::Handle (char **parameters, int pcnt, userrec *user) return; if ((parameters[0][0] == '$') && ((*user->oper) || (is_uline(user->server)))) { - // notice to server mask - char* servermask = parameters[0]; - servermask++; - if (match(Config->ServerName,servermask)) - { - ServerPrivmsgAll("%s",parameters[1]); - } - return; + int MOD_RESULT = 0; + std::string temp = parameters[1]; + FOREACH_RESULT(I_OnUserPreMessage,OnUserPreMessage(user,(void*)parameters[0],TYPE_SERVER,temp,0)); + if (MOD_RESULT) + return; + parameters[1] = (char*)temp.c_str(); + // notice to server mask + const char* servermask = parameters[0] + 1; + if (match(Config->ServerName,servermask)) + { + ServerPrivmsgAll("%s",parameters[1]); + } + FOREACH_MOD(I_OnUserMessage,OnUserMessage(user,(void*)parameters[0],TYPE_SERVER,parameters[1],0)); + return; } char status = 0; if ((*parameters[0] == '@') || (*parameters[0] == '%') || (*parameters[0] == '+')) |
