X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_motd.cpp;h=9ed5ff188079fa1a86e3bc4737e128470c471425;hb=39ddf2fb7a4d030fc29a7d421e09394cd70dc9bf;hp=8e227723ee57f0bcca916fd1f66e85a4a6dcb241;hpb=c79475caa82104e82f9a914b7673bd61f7a1f01f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_motd.cpp b/src/commands/cmd_motd.cpp index 8e227723e..9ed5ff188 100644 --- a/src/commands/cmd_motd.cpp +++ b/src/commands/cmd_motd.cpp @@ -51,9 +51,15 @@ class CommandMotd : public Command CmdResult CommandMotd::Handle (const std::vector& parameters, User *user) { if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName) + { + // Give extra penalty if a non-oper queries the /MOTD of a remote server + LocalUser* localuser = IS_LOCAL(user); + if ((localuser) && (!IS_OPER(user))) + localuser->CommandFloodPenalty += 2000; return CMD_SUCCESS; + } - ConfigTag* tag = NULL; + ConfigTag* tag = ServerInstance->Config->EmptyTag; if (IS_LOCAL(user)) tag = user->GetClass()->config; std::string motd_name = tag->getString("motd", "motd");