aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/uid.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-03-30 17:52:02 +0100
committerGravatar Sadie Powell2021-03-30 18:25:55 +0100
commit49702c621eed54caee6a45c0518d68a33bca8f92 (patch)
tree94623f04b8635fbff3f1a90117c32d44fce11075 /src/modules/m_spanningtree/uid.cpp
parentRemove multi-line FJOIN and FMODE logic. (diff)
Convert various mode methods to take Mode::Change.
- AccessCheck - AfterMode - BeforeMode - OnModeChange - OnRawMode
Diffstat (limited to 'src/modules/m_spanningtree/uid.cpp')
-rw-r--r--src/modules/m_spanningtree/uid.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp
index 1a53b8bc4..f4bf2d913 100644
--- a/src/modules/m_spanningtree/uid.cpp
+++ b/src/modules/m_spanningtree/uid.cpp
@@ -38,7 +38,6 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, CommandBase::Params
*/
time_t age_t = ServerCommand::ExtractTS(params[1]);
time_t signon = ServerCommand::ExtractTS(params[7]);
- std::string empty;
const std::string& modestr = params[8];
// Check if the length of the uuid is correct and confirm the sid portion of the uuid matches the sid of the server introducing the user
@@ -102,7 +101,7 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, CommandBase::Params
{
if (paramptr >= params.size() - 1)
throw ProtocolException("Out of parameters while processing modes");
- std::string mp = params[paramptr++];
+
/* IMPORTANT NOTE:
* All modes are assumed to succeed here as they are being set by a remote server.
* Modes CANNOT FAIL here. If they DO fail, then the failure is ignored. This is important
@@ -112,10 +111,14 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, CommandBase::Params
* will not change in future versions if you want to make use of this protective behaviour
* yourself.
*/
- mh->OnModeChange(_new, _new, NULL, mp, true);
+ Modes::Change modechange(mh, true, params[paramptr++]);
+ mh->OnModeChange(_new, _new, NULL, modechange);
}
else
- mh->OnModeChange(_new, _new, NULL, empty, true);
+ {
+ Modes::Change modechange(mh, true, "");
+ mh->OnModeChange(_new, _new, NULL, modechange);
+ }
_new->SetMode(mh, true);
}