X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_info%2Fcmd_modules.cpp;h=7624ce05f0d26275526c467243d956e7f3be3135;hb=ee23dd450ed713d907d0ecdeec356971439d4356;hp=47dd2dc9291989882b0da398cebaad973cdf1f9c;hpb=9eac41bf5a33829c300a4f87cb539de8a23e3d73;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_info/cmd_modules.cpp b/src/coremods/core_info/cmd_modules.cpp index 47dd2dc92..7624ce05f 100644 --- a/src/coremods/core_info/cmd_modules.cpp +++ b/src/coremods/core_info/cmd_modules.cpp @@ -1,9 +1,14 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2017-2020 Sadie Powell + * Copyright (C) 2013-2016 Attila Molnar + * Copyright (C) 2013 Daniel Vassdal + * Copyright (C) 2012 Robby + * Copyright (C) 2009 Uli Schlachter * Copyright (C) 2009 Daniel De Graaf - * Copyright (C) 2008 Craig Edwards - * Copyright (C) 2007 Robin Burchell + * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2005, 2007-2008 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 @@ -38,11 +43,11 @@ CommandModules::CommandModules(Module* parent) /** Handle /MODULES */ -CmdResult CommandModules::Handle (const std::vector& parameters, User *user) +CmdResult CommandModules::Handle(User* user, const Params& parameters) { // Don't ask remote servers about their modules unless the local user asking is an oper // 2.0 asks anyway, so let's handle that the same way - bool for_us = (parameters.empty() || parameters[0] == ServerInstance->Config->ServerName); + bool for_us = (parameters.empty() || irc::equals(parameters[0], ServerInstance->Config->ServerName)); if ((!for_us) || (!IS_LOCAL(user))) { if (!user->IsOper()) @@ -66,17 +71,13 @@ CmdResult CommandModules::Handle (const std::vector& parameters, Us if (IS_LOCAL(user) && user->HasPrivPermission("servers/auspex")) { std::string flags("VCO"); - int pos = 0; + size_t pos = 0; for (int mult = 2; mult <= VF_OPTCOMMON; mult *= 2, ++pos) if (!(V.Flags & mult)) flags[pos] = '-'; -#ifdef INSPIRCD_STATIC - user->WriteRemoteNumeric(RPL_MODLIST, m->ModuleSourceFile, INSPIRCD_VERSION, flags, V.description); -#else - std::string srcrev = m->ModuleDLLManager->GetVersion(); - user->WriteRemoteNumeric(RPL_MODLIST, m->ModuleSourceFile, srcrev.empty() ? "*" : srcrev, flags, V.description); -#endif + const char* srcrev = m->ModuleDLLManager->GetVersion(); + user->WriteRemoteNumeric(RPL_MODLIST, m->ModuleSourceFile, srcrev ? srcrev : "*", flags, V.description); } else {