]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/uid.cpp
Only assign NewServices once the duplicate check is done.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / uid.cpp
index 01af56fa655806ea86266d1e56b90f81336609ed..cc5acccf93eb04e0a3f585b3f9a0bdbf328a5164 100644 (file)
@@ -1,9 +1,13 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
- *   Copyright (C) 2010 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2017-2019 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2013 Adam <Adam@anope.org>
+ *   Copyright (C) 2012-2016 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2012 Robby <robby@chatbelgie.be>
+ *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2008, 2010 Craig Edwards <brain@inspircd.org>
  *   Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
- *   Copyright (C) 2008 Craig Edwards <craigedwards@brainbox.cc>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
  * redistribute it and/or modify it under the terms of the GNU General Public
@@ -38,7 +42,7 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, CommandBase::Params
        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
-       if (params[0].length() != UIDGenerator::UUID_LENGTH || params[0].compare(0, 3, remoteserver->GetID()))
+       if (params[0].length() != UIDGenerator::UUID_LENGTH || params[0].compare(0, 3, remoteserver->GetId()))
                throw ProtocolException("Bogus UUID");
        // Sanity check on mode string: must begin with '+'
        if (modestr[0] != '+')
@@ -89,7 +93,7 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, CommandBase::Params
                if (*v == '+')
                        continue;
 
-               /* For each mode thats set, find the mode handler and set it on the new user */
+               /* For each mode that's set, find the mode handler and set it on the new user */
                ModeHandler* mh = ServerInstance->Modes->FindMode(*v, MODETYPE_USER);
                if (!mh)
                        throw ProtocolException("Unrecognised mode '" + std::string(1, *v) + "'");
@@ -134,7 +138,7 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, CommandBase::Params
 }
 
 CmdResult CommandFHost::HandleRemote(RemoteUser* src, Params& params)
-{              
+{
        src->ChangeDisplayedHost(params[0]);
        return CMD_SUCCESS;
 }
@@ -152,7 +156,7 @@ CmdResult CommandFName::HandleRemote(RemoteUser* src, Params& params)
 }
 
 CommandUID::Builder::Builder(User* user)
-       : CmdBuilder(TreeServer::Get(user)->GetID(), "UID")
+       : CmdBuilder(TreeServer::Get(user), "UID")
 {
        push(user->uuid);
        push_int(user->age);