X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_info%2Fcmd_motd.cpp;h=1422ffa0331efceb70284e0bb14cb4f137fa7b45;hb=c83a670c194ba3c9cf6a1fc7d670414e3dfeaa3e;hp=cc770b157bf3bedd218f1f4c717a74f7a60765b8;hpb=384ef31bc01e4a1a2e59d082c9066002410ba54a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_info/cmd_motd.cpp b/src/coremods/core_info/cmd_motd.cpp index cc770b157..1422ffa03 100644 --- a/src/coremods/core_info/cmd_motd.cpp +++ b/src/coremods/core_info/cmd_motd.cpp @@ -1,8 +1,12 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2014, 2018-2019 Sadie Powell + * Copyright (C) 2013-2016 Attila Molnar + * Copyright (C) 2012 Robby * Copyright (C) 2009-2010 Daniel De Graaf - * Copyright (C) 2007 Robin Burchell + * 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 @@ -31,7 +35,7 @@ CommandMotd::CommandMotd(Module* parent) */ CmdResult CommandMotd::Handle(User* user, const Params& parameters) { - if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName) + if (parameters.size() > 0 && !irc::equals(parameters[0], ServerInstance->Config->ServerName)) { // Give extra penalty if a non-oper queries the /MOTD of a remote server LocalUser* localuser = IS_LOCAL(user); @@ -45,8 +49,8 @@ CmdResult CommandMotd::Handle(User* user, const Params& parameters) if (localuser) tag = localuser->GetClass()->config; std::string motd_name = tag->getString("motd", "motd"); - ConfigFileCache::iterator motd = ServerInstance->Config->Files.find(motd_name); - if (motd == ServerInstance->Config->Files.end()) + ConfigFileCache::iterator motd = motds.find(motd_name); + if (motd == motds.end()) { user->WriteRemoteNumeric(ERR_NOMOTD, "Message of the day file is missing."); return CMD_SUCCESS; @@ -55,7 +59,7 @@ CmdResult CommandMotd::Handle(User* user, const Params& parameters) user->WriteRemoteNumeric(RPL_MOTDSTART, InspIRCd::Format("%s message of the day", ServerInstance->Config->ServerName.c_str())); for (file_cache::iterator i = motd->second.begin(); i != motd->second.end(); i++) - user->WriteRemoteNumeric(RPL_MOTD, InspIRCd::Format("- %s", i->c_str())); + user->WriteRemoteNumeric(RPL_MOTD, InspIRCd::Format(" %s", i->c_str())); user->WriteRemoteNumeric(RPL_ENDOFMOTD, "End of message of the day.");