]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Merge pull request #971 from SaberUK/master+numeric-xline
authorAttila Molnar <attilamolnar@hush.com>
Thu, 5 Feb 2015 16:37:26 +0000 (17:37 +0100)
committerAttila Molnar <attilamolnar@hush.com>
Thu, 5 Feb 2015 16:37:26 +0000 (17:37 +0100)
Use ERR_YOUREBANNEDCREEP instead of NOTICE when a user is banned.

1  2 
src/usermanager.cpp

diff --combined src/usermanager.cpp
index 5d07c4d792375de68b78bfc870813dcedfaaa536,0efad66b46c521ad9ceb314927a4b442544d8f7d..1966c9b4729f86193e8c8fa87694a3bf9395c936
  #include "xline.h"
  #include "iohook.h"
  
 +namespace
 +{
 +      class WriteCommonQuit : public User::ForEachNeighborHandler
 +      {
 +              std::string line;
 +              std::string operline;
 +
 +              void Execute(LocalUser* user) CXX11_OVERRIDE
 +              {
 +                      user->Write(user->IsOper() ? operline : line);
 +              }
 +
 +       public:
 +              WriteCommonQuit(User* user, const std::string& msg, const std::string& opermsg)
 +                      : line(":" + user->GetFullHost() + " QUIT :")
 +                      , operline(line)
 +              {
 +                      line += msg;
 +                      operline += opermsg;
 +                      user->ForEachNeighbor(*this, false);
 +              }
 +      };
 +}
 +
  UserManager::UserManager()
        : unregistered_count(0)
  {
@@@ -136,7 -112,7 +136,7 @@@ void UserManager::AddUser(int socket, L
                        /* user banned */
                        ServerInstance->Logs->Log("BANCACHE", LOG_DEBUG, "BanCache: Positive hit for " + New->GetIPString());
                        if (!ServerInstance->Config->XLineMessage.empty())
-                               New->WriteNotice("*** " +  ServerInstance->Config->XLineMessage);
+                               New->WriteNumeric(ERR_YOUREBANNEDCREEP, ":" + ServerInstance->Config->XLineMessage);
                        this->QuitUser(New, b->Reason);
                        return;
                }
@@@ -204,7 -180,7 +204,7 @@@ void UserManager::QuitUser(User* user, 
        if (user->registered == REG_ALL)
        {
                FOREACH_MOD(OnUserQuit, (user, reason, *operreason));
 -              user->WriteCommonQuit(reason, *operreason);
 +              WriteCommonQuit(user, reason, *operreason);
        }
        else
                unregistered_count--;