]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Remove now-unused quitmsg/operquitmsg fields from User
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 2 Sep 2009 00:50:21 +0000 (00:50 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 2 Sep 2009 00:50:21 +0000 (00:50 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11637 e03df62e-2008-0410-955e-edbf42e46eb7

include/users.h
src/commands/cmd_quit.cpp
src/modules/m_spanningtree/main.cpp
src/modules/m_spanningtree/operquit.cpp
src/modules/m_spanningtree/treeserver.cpp
src/usermanager.cpp
src/users.cpp

index 19d78ec23c37314d2b24f0cddbc98edb7c93c396..14f98f70163e50451cd7c9fc12b2dbf9ca77ce0c 100644 (file)
@@ -457,14 +457,6 @@ class CoreExport User : public EventHandler
         */
        std::string sendq;
 
-       /** Message user will quit with. Not to be set externally.
-        */
-       std::string quitmsg;
-
-       /** Quit message shown to opers - not to be set externally.
-        */
-       std::string operquitmsg;
-
        /** Whether or not to send an snotice about this user's quitting
         */
        bool quietquit;
@@ -952,16 +944,6 @@ class CoreExport User : public EventHandler
         */
        void ShowRULES();
 
-       /** Set oper-specific quit message shown to opers only when the user quits
-        * (overrides any sent by QuitUser)
-        */
-       void SetOperQuit(const std::string &oquit);
-
-       /** Get oper-specific quit message shown only to opers when the user quits.
-        * (overrides any sent by QuitUser)
-        */
-       const std::string& GetOperQuit();
-
        /** Increases a user's command penalty by a set amount.
         */
        void IncreasePenalty(int increase);
index 9c039216261e740b1ca2c48eefde67db71a7f957..e29382e848561386dd06d7d8694fbf1814f5d24f 100644 (file)
@@ -38,7 +38,16 @@ CmdResult CommandQuit::Handle (const std::vector<std::string>& parameters, User
        else
                quitmsg = parameters.size() ? parameters[0] : "Client exited";
 
-       ServerInstance->Users->QuitUser(user, quitmsg);
+       std::string* operquit;
+       if (user->GetExt("operquit", operquit))
+       {
+               ServerInstance->Users->QuitUser(user, quitmsg, operquit->c_str());
+               delete operquit;
+       }
+       else
+       {
+               ServerInstance->Users->QuitUser(user, quitmsg);
+       }
 
        return CMD_SUCCESS;
 }
index 3e2b5d3b5c48c5aa06e747b4c150c4eddfdefffd..ed0165c0eb21f6ebfba42d188b9796f3f03c585d 100644 (file)
@@ -711,13 +711,13 @@ void ModuleSpanningTree::OnRemoteKill(User* source, User* dest, const std::strin
        if (!IS_LOCAL(source))
                return; // Only start routing if we're origin.
 
+       dest->Extend("operquit", new std::string(operreason));
        parameterlist params;
-       params.push_back(":"+reason);
+       params.push_back(":"+operreason);
        Utils->DoOneToMany(dest->uuid,"OPERQUIT",params);
        params.clear();
        params.push_back(dest->uuid);
        params.push_back(":"+reason);
-       dest->SetOperQuit(operreason);
        Utils->DoOneToMany(source->uuid,"KILL",params);
 }
 
index a71f73da7c85e8dfa8c7d83d4b26d88843c26c9a..5260cd990d372d2292a00ef61c61574386d41013 100644 (file)
@@ -30,7 +30,7 @@ bool TreeSocket::OperQuit(const std::string &prefix, parameterlist &params)
 
        if (u)
        {
-               u->SetOperQuit(params[0]);
+               u->Extend("operquit", new std::string(params[0]));
                params[0] = ":" + params[0];
                Utils->DoOneToAllButSender(prefix,"OPERQUIT",params,prefix);
        }
index 6c8c6a33ceada99a4a3fa9f2c343ce14bf4cf5e6..c9f4cfdfa7fcf1e11cfe219ac97e610eb762f3fd 100644 (file)
@@ -176,13 +176,13 @@ int TreeServer::QuitUsers(const std::string &reason)
                User* a = (User*)*n;
                if (!IS_LOCAL(a))
                {
+                       if (this->Utils->quiet_bursts)
+                               a->quietquit = true;
+
                        if (ServerInstance->Config->HideSplits)
                                ServerInstance->Users->QuitUser(a, "*.net *.split", reason_s);
                        else
                                ServerInstance->Users->QuitUser(a, reason_s);
-
-                       if (this->Utils->quiet_bursts)
-                               a->quietquit = true;
                }
        }
        return time_to_die.size();
index 31ffad00767f8ac9278bc7eed13806eba7cd4cf4..adec2fe16d9e91e5cd4be1e5528c39fdd3e48113 100644 (file)
@@ -176,22 +176,13 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char
        ServerInstance->Logs->Log("USERS", DEBUG, "QuitUser: %s '%s'", user->nick.c_str(), quitreason.c_str());
        user->Write("ERROR :Closing link: (%s@%s) [%s]", user->ident.c_str(), user->host.c_str(), *operreason ? operreason : quitreason.c_str());
 
-       user->quietquit = false;
-       user->quitmsg = quitreason;
-
        std::string reason;
        std::string oper_reason;
        reason.assign(quitreason, 0, ServerInstance->Config->Limits.MaxQuit);
-       if (!*operreason)
-       {
-               user->operquitmsg = quitreason;
-               oper_reason.assign(quitreason, 0, ServerInstance->Config->Limits.MaxQuit);
-       }
-       else
-       {
-               user->operquitmsg = operreason;
+       if (operreason && *operreason)
                oper_reason.assign(operreason, 0, ServerInstance->Config->Limits.MaxQuit);
-       }
+       else
+               oper_reason = quitreason;
 
        ServerInstance->GlobalCulls.AddItem(user);
 
@@ -244,7 +235,7 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char
                        if (!user->quietquit)
                        {
                                ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s!%s@%s [%s]",
-                                       user->nick.c_str(), user->ident.c_str(), user->host.c_str(), user->operquitmsg.c_str());
+                                       user->nick.c_str(), user->ident.c_str(), user->host.c_str(), oper_reason.c_str());
                        }
                }
                else
@@ -252,7 +243,7 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char
                        if ((!ServerInstance->SilentULine(user->server)) && (!user->quietquit))
                        {
                                ServerInstance->SNO->WriteToSnoMask('Q',"Client exiting on server %s: %s!%s@%s [%s]",
-                                       user->server, user->nick.c_str(), user->ident.c_str(), user->host.c_str(), user->operquitmsg.c_str());
+                                       user->server, user->nick.c_str(), user->ident.c_str(), user->host.c_str(), oper_reason.c_str());
                        }
                }
                user->AddToWhoWas();
index 35aa2cd303c6a8b27c77bf0e0e2675eb811ff008..dfff7f034ad9b3aa8aa355b7d06b64acf122cd45 100644 (file)
@@ -1926,16 +1926,6 @@ void User::HandleEvent(EventType et, int errornum)
        }
 }
 
-void User::SetOperQuit(const std::string &oquit)
-{
-       operquitmsg = oquit;
-}
-
-const std::string& User::GetOperQuit()
-{
-       return operquitmsg;
-}
-
 void User::IncreasePenalty(int increase)
 {
        this->Penalty += increase;