diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-09 15:29:42 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-09 15:29:42 +0000 |
commit | be60fccc6ca656636924d28eb1fa870f7e8f0144 (patch) | |
tree | 02cf1be2f13f15c236244baa3d38eda0f176c279 /src/mode.cpp | |
parent | b752181177a868a192ede87305957c165fa274f8 (diff) |
Make SAMODE oper output tidier
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5184 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/mode.cpp')
-rw-r--r-- | src/mode.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index f74a2ac60..ddc2d4d16 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -509,10 +509,18 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool if (type == MODETYPE_CHANNEL) { targetchannel->WriteChannelWithServ(ServerInstance->Config->ServerName, "MODE %s %s%s", targetchannel->name, output_sequence.c_str(), parameter_list.str().c_str()); + this->LastParse = targetchannel->name; + LastParse.append(" "); + LastParse.append(output_sequence); + LastParse.append(parameter_list.str()); } else { targetuser->WriteServ("MODE %s %s%s",targetuser->nick,output_sequence.c_str(), parameter_list.str().c_str()); + this->LastParse = targetuser->nick; + LastParse.append(" "); + LastParse.append(output_sequence); + LastParse.append(parameter_list.str()); } } else @@ -522,17 +530,30 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool ServerInstance->Log(DEBUG,"Write output sequence and parameters to channel: %s %s%s",targetchannel->name,output_sequence.c_str(),parameter_list.str().c_str()); targetchannel->WriteChannel(user,"MODE %s %s%s",targetchannel->name,output_sequence.c_str(),parameter_list.str().c_str()); FOREACH_MOD(I_OnMode,OnMode(user, targetchannel, TYPE_CHANNEL, output_sequence + parameter_list.str())); + this->LastParse = targetchannel->name; + LastParse.append(" "); + LastParse.append(output_sequence); + LastParse.append(parameter_list.str()); } else { user->WriteTo(targetuser,"MODE %s %s%s",targetuser->nick,output_sequence.c_str(), parameter_list.str().c_str()); FOREACH_MOD(I_OnMode,OnMode(user, targetuser, TYPE_USER, output_sequence)); + this->LastParse = targetuser->nick; + LastParse.append(" "); + LastParse.append(output_sequence); + LastParse.append(parameter_list.str()); } } } } } +const std::string& ModeParser::GetLastParse() +{ + return LastParse; +} + void ModeParser::CleanMask(std::string &mask) { std::string::size_type pos_of_pling = mask.find_first_of('!'); @@ -905,6 +926,9 @@ ModeParser::ModeParser(InspIRCd* Instance) : ServerInstance(Instance) memset(modehandlers, 0, sizeof(modehandlers)); memset(modewatchers, 0, sizeof(modewatchers)); + /* Last parse string */ + LastParse = ""; + /* Initialise the RFC mode letters */ /* Start with channel simple modes, no params */ |