X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_sethost.cpp;h=06f62b443411578aca140dd54a4c359f9a0fd0f0;hb=fe67c13ddf8f546bed95a9904679b3f32c708cd9;hp=b75bac425e2558594a4da3a59fb3ad4ac9e1b041;hpb=198e2a442c9c3fffb5ecc9ff18a6e99cf4c7d912;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index b75bac425..06f62b443 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -1,9 +1,13 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2013, 2017-2018, 2020 Sadie Powell + * Copyright (C) 2012-2013 Attila Molnar + * Copyright (C) 2012, 2019 Robby + * Copyright (C) 2009 Daniel De Graaf * Copyright (C) 2007 Robin Burchell - * Copyright (C) 2004-2006 Craig Edwards + * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2006, 2010 Craig Edwards * * 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 @@ -32,10 +36,11 @@ class CommandSethost : public Command : Command(Creator,"SETHOST", 1) { allow_empty_last_param = false; - flags_needed = 'o'; syntax = ""; + flags_needed = 'o'; + syntax = ""; } - CmdResult Handle(const std::vector& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { if (parameters[0].length() > ServerInstance->Config->Limits.MaxHost) { @@ -45,7 +50,7 @@ class CommandSethost : public Command for (std::string::const_iterator x = parameters[0].begin(); x != parameters[0].end(); x++) { - if (!hostmap.test(*x)) + if (!hostmap.test(static_cast(*x))) { user->WriteNotice("*** SETHOST: Invalid characters in hostname"); return CMD_FAILURE; @@ -75,16 +80,17 @@ class ModuleSetHost : public Module void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { - std::string hmap = ServerInstance->Config->ConfValue("hostname")->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789"); + ConfigTag* tag = ServerInstance->Config->ConfValue("hostname"); + const std::string hmap = tag->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789", 1); cmd.hostmap.reset(); - for (std::string::iterator n = hmap.begin(); n != hmap.end(); n++) - cmd.hostmap.set(*n); + for (std::string::const_iterator n = hmap.begin(); n != hmap.end(); n++) + cmd.hostmap.set(static_cast(*n)); } Version GetVersion() CXX11_OVERRIDE { - return Version("Provides support for the SETHOST command", VF_VENDOR); + return Version("Adds the /SETHOST command which allows server operators to change their displayed hostname.", VF_VENDOR); } };