summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_conn_umodes.cpp20
-rw-r--r--src/modules/m_samode.cpp2
-rw-r--r--src/modules/m_timedbans.cpp6
-rw-r--r--src/users.cpp2
4 files changed, 9 insertions, 21 deletions
diff --git a/src/modules/m_conn_umodes.cpp b/src/modules/m_conn_umodes.cpp
index bae9317d5..1e3ea1a49 100644
--- a/src/modules/m_conn_umodes.cpp
+++ b/src/modules/m_conn_umodes.cpp
@@ -51,26 +51,14 @@ class ModuleModesOnConnect : public Module
std::string buf;
std::stringstream ss(ThisModes);
- std::vector<std::string> tokens;
-
- // split ThisUserModes into modes and mode params
- while (ss >> buf)
- tokens.push_back(buf);
-
std::vector<std::string> modes;
modes.push_back(user->nick);
- modes.push_back(tokens[0]);
- if (tokens.size() > 1)
- {
- // process mode params
- for (unsigned int k = 1; k < tokens.size(); k++)
- {
- modes.push_back(tokens[k]);
- }
- }
+ // split ThisUserModes into modes and mode params
+ while (ss >> buf)
+ modes.push_back(buf);
- ServerInstance->Parser->CallHandler("MODE", modes, user);
+ ServerInstance->Modes->Process(modes, user);
}
memcpy(ServerInstance->Config->DisabledUModes, save, 64);
diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp
index cd0417aba..a549f89a7 100644
--- a/src/modules/m_samode.cpp
+++ b/src/modules/m_samode.cpp
@@ -44,7 +44,7 @@ class CommandSamode : public Command
return CMD_FAILURE;
}
this->active = true;
- ServerInstance->Parser->CallHandler("MODE", parameters, user);
+ ServerInstance->Modes->Process(parameters, user);
if (ServerInstance->Modes->GetLastParse().length())
ServerInstance->SNO->WriteGlobalSno('a', user->nick + " used SAMODE: " +ServerInstance->Modes->GetLastParse());
this->active = false;
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index afb042da0..29691b338 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -79,9 +79,9 @@ class CommandTban : public Command
mask.append("!*@*");
setban.push_back(mask);
- // use CallHandler to make it so that the user sets the mode
- // themselves
- ServerInstance->Parser->CallHandler("MODE",setban,user);
+ // Pass the user (instead of ServerInstance->FakeClient) to ModeHandler::Process() to
+ // make it so that the user sets the mode themselves
+ ServerInstance->Modes->Process(setban, user);
if (ServerInstance->Modes->GetLastParse().empty())
{
user->WriteNotice("Invalid ban mask");
diff --git a/src/users.cpp b/src/users.cpp
index 649a325c9..371fa3bb6 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -486,7 +486,7 @@ void User::UnOper()
parameters.push_back(this->nick);
parameters.push_back(moderemove);
- ServerInstance->Parser->CallHandler("MODE", parameters, this);
+ ServerInstance->Modes->Process(parameters, this);
/* remove the user from the oper list. Will remove multiple entries as a safeguard against bug #404 */
ServerInstance->Users->all_opers.remove(this);