From 49702c621eed54caee6a45c0518d68a33bca8f92 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 30 Mar 2021 17:52:02 +0100 Subject: Convert various mode methods to take Mode::Change. - AccessCheck - AfterMode - BeforeMode - OnModeChange - OnRawMode --- src/modules/m_spanningtree/uid.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/modules/m_spanningtree/uid.cpp') 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); } -- cgit v1.3.1-10-gc9f91