X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_info%2Fcmd_modules.cpp;h=7624ce05f0d26275526c467243d956e7f3be3135;hb=e2b0f3dc9ef4d56c71d7abda13e6139ca092e387;hp=fa8c2aebbc61c2c91be428d09f69d91cc67830da;hpb=36040be2952186d56a6646ee7d972aaafdd4e31a;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 fa8c2aebb..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()) @@ -71,12 +76,8 @@ CmdResult CommandModules::Handle (const std::vector& parameters, Us 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 {