From da8fe330c2b3445b370cb80ecae93c7fb34d441d Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 22 May 2004 20:41:16 +0000 Subject: Added support for changing of text within OnUserPreNotice and OnUserPreMessage (required for modes +G and +S etc) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@821 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/commands.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/commands.cpp') diff --git a/src/commands.cpp b/src/commands.cpp index 5b3c14f98..5144d7ae5 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -560,10 +560,12 @@ void handle_privmsg(char **parameters, int pcnt, userrec *user) int MOD_RESULT = 0; - FOREACH_RESULT(OnUserPreMessage(user,chan,TYPE_CHANNEL,std::string(parameters[1]))); + std::string temp = parameters[1]; + FOREACH_RESULT(OnUserPreMessage(user,chan,TYPE_CHANNEL,temp)); if (MOD_RESULT) { return; } + parameters[1] = (char*)temp.c_str(); ChanExceptSender(chan, user, "PRIVMSG %s :%s", chan->name, parameters[1]); @@ -591,10 +593,12 @@ void handle_privmsg(char **parameters, int pcnt, userrec *user) int MOD_RESULT = 0; - FOREACH_RESULT(OnUserPreMessage(user,dest,TYPE_USER,std::string(parameters[1]))); + std::string temp = parameters[1]; + FOREACH_RESULT(OnUserPreMessage(user,dest,TYPE_USER,temp)); if (MOD_RESULT) { return; } + parameters[1] = (char*)temp.c_str(); @@ -643,11 +647,13 @@ void handle_notice(char **parameters, int pcnt, userrec *user) } int MOD_RESULT = 0; - - FOREACH_RESULT(OnUserPreNotice(user,chan,TYPE_CHANNEL,std::string(parameters[1]))); + + std::string temp = parameters[1]; + FOREACH_RESULT(OnUserPreNotice(user,chan,TYPE_CHANNEL,temp)); if (MOD_RESULT) { return; } + parameters[1] = (char*)temp.c_str(); ChanExceptSender(chan, user, "NOTICE %s :%s", chan->name, parameters[1]); @@ -669,10 +675,12 @@ void handle_notice(char **parameters, int pcnt, userrec *user) { int MOD_RESULT = 0; - FOREACH_RESULT(OnUserPreNotice(user,dest,TYPE_USER,std::string(parameters[1]))); + std::string temp = parameters[1]; + FOREACH_RESULT(OnUserPreNotice(user,dest,TYPE_USER,temp)); if (MOD_RESULT) { return; } + parameters[1] = (char*)temp.c_str(); if (!strcmp(dest->server,user->server)) { -- cgit v1.3.1-10-gc9f91