From 9c213ae9c6f9f694f5f85f22b6af507ceba55acb Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 25 Jul 2006 10:30:54 +0000 Subject: Allow PRIVMSG and NOTICE targets of $ to the module events (this wasnt trivial and is almost a damn feature) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4539 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_notice.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/cmd_notice.cpp') diff --git a/src/cmd_notice.cpp b/src/cmd_notice.cpp index b9bd536d0..fbbeafec0 100644 --- a/src/cmd_notice.cpp +++ b/src/cmd_notice.cpp @@ -47,13 +47,20 @@ void cmd_notice::Handle (const char** parameters, int pcnt, userrec *user) return; if ((parameters[0][0] == '$') && ((*user->oper) || (is_uline(user->server)))) { - // notice to server mask - const char* servermask = parameters[0] + 1; - if (match(Config->ServerName,servermask)) - { - NoticeAll(user, true, "%s",parameters[1]); - } - return; + int MOD_RESULT = 0; + std::string temp = parameters[1]; + FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(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)) + { + NoticeAll(user, true, "%s",parameters[1]); + } + FOREACH_MOD(I_OnUserMessage,OnUserNotice(user,(void*)parameters[0],TYPE_SERVER,parameters[1],0)); + return; } char status = 0; if ((*parameters[0] == '@') || (*parameters[0] == '%') || (*parameters[0] == '+')) -- cgit v1.2.3