]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_motd.cpp
m_dccallow Add config option to control max entries on a list
[user/henk/code/inspircd.git] / src / commands / cmd_motd.cpp
index 8e227723ee57f0bcca916fd1f66e85a4a6dcb241..9ed5ff188079fa1a86e3bc4737e128470c471425 100644 (file)
@@ -51,9 +51,15 @@ class CommandMotd : public Command
 CmdResult CommandMotd::Handle (const std::vector<std::string>& 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");