]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Remove now needless User::ForceNickChange()
authorAttila Molnar <attilamolnar@hush.com>
Thu, 3 Jul 2014 10:27:24 +0000 (12:27 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Thu, 3 Jul 2014 10:27:24 +0000 (12:27 +0200)
Change call sites to call ChangeNick()

include/users.h
src/coremods/core_user/cmd_nick.cpp
src/modules/m_nicklock.cpp
src/modules/m_sanick.cpp
src/modules/m_spanningtree/nick.cpp
src/modules/m_spanningtree/nickcollide.cpp
src/modules/m_spanningtree/save.cpp
src/modules/m_spanningtree/svsnick.cpp
src/users.cpp
src/xline.cpp

index 0f8154bef5b349d94793d2d54624d9d5b01fda11..4029daa5346bccd899d44853a5c44cc6f9971fd7 100644 (file)
@@ -462,15 +462,6 @@ class CoreExport User : public Extensible
         */
        void Oper(OperInfo* info);
 
-       /** Force a nickname change.
-        * If the nickname change fails (for example, because the nick in question
-        * already exists) this function will return false, and you must then either
-        * output an error message, or quit the user for nickname collision.
-        * @param newnick The nickname to change to
-        * @return True if the nickchange was successful.
-        */
-       bool ForceNickChange(const std::string& newnick, time_t newts = 0) { return ChangeNick(newnick, true, newts); }
-
        /** Oper down.
         * This will clear the +o usermode and unset the user's oper type
         */
@@ -598,10 +589,9 @@ class CoreExport User : public Extensible
 
        /** Change a user's nick
         * @param newnick The new nick
-        * @param force True if the change is being forced (should not be blocked by modes like +N)
         * @return True if the change succeeded
         */
-       bool ChangeNick(const std::string& newnick, bool force = false, time_t newts = 0);
+       bool ChangeNick(const std::string& newnick, time_t newts = 0);
 
        /** Remove this user from all channels they are on, and delete any that are now empty.
         * This is used by QUIT, and will not send part messages!
index a28c4045198cfc30a2eba394a7608e8b0614aecf..1d14ca703d6be45faf7198c4a6f652d6cfc6ad7b 100644 (file)
@@ -83,7 +83,7 @@ CmdResult CommandNick::HandleLocal(const std::vector<std::string>& parameters, L
                }
        }
 
-       if (!user->ChangeNick(newnick, false))
+       if (!user->ChangeNick(newnick))
                return CMD_FAILURE;
 
        if (user->registered < REG_NICKUSER)
index 21f02fe11d19286b7eafa335c34143eb5861c3d3..9bf16498ac548b80870d31778f7181ef63201797 100644 (file)
@@ -64,7 +64,7 @@ class CommandNicklock : public Command
                        locked.set(target, 1);
 
                        std::string oldnick = target->nick;
-                       if (target->ForceNickChange(parameters[1]))
+                       if (target->ChangeNick(parameters[1]))
                                ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used NICKLOCK to change and hold "+oldnick+" to "+parameters[1]);
                        else
                        {
index ca6be2211978f2d92c1ac0608a8126acbddd96d3..ba265fddd29acaeb2d9e7059f2d2d074634e081d 100644 (file)
@@ -64,7 +64,7 @@ class CommandSanick : public Command
                {
                        std::string oldnick = user->nick;
                        std::string newnick = target->nick;
-                       if (target->ChangeNick(parameters[1], true))
+                       if (target->ChangeNick(parameters[1]))
                        {
                                ServerInstance->SNO->WriteGlobalSno('a', oldnick+" used SANICK to change "+newnick+" to "+parameters[1]);
                        }
index 73390163241fdd95ed4eb97607aec2528ae620b8..ecec849eecb640a451f18ecca3ee02cc55768faf 100644 (file)
@@ -57,6 +57,6 @@ CmdResult CommandNick::HandleRemote(RemoteUser* user, std::vector<std::string>&
                        return CMD_FAILURE;
                }
        }
-       user->ForceNickChange(params[0], newts);
+       user->ChangeNick(params[0], newts);
        return CMD_SUCCESS;
 }
index 30be98fb5b89317448c856fae1a6f6a8201ae461..935ccd6bdd53a805e21024277c53d949fcf91412 100644 (file)
@@ -114,7 +114,7 @@ int SpanningTreeUtilities::DoCollision(User* u, TreeServer* server, time_t remot
                params.push_back(ConvToStr(u->age));
                params.Broadcast();
 
-               u->ForceNickChange(u->uuid);
+               u->ChangeNick(u->uuid);
 
                if (!bChangeRemote)
                        return 1;
@@ -133,7 +133,7 @@ int SpanningTreeUtilities::DoCollision(User* u, TreeServer* server, time_t remot
                if (remote)
                {
                        /* nick change collide. Force change their nick. */
-                       remote->ForceNickChange(remoteuid);
+                       remote->ChangeNick(remoteuid);
                }
 
                if (!bChangeLocal)
index 03d4012117c6ad2ffa6094ea3629f93634dcb1ed..dd9e866a977f2c2f49930ca0b1c1c8fd83976966 100644 (file)
@@ -36,7 +36,7 @@ CmdResult CommandSave::Handle(User* user, std::vector<std::string>& params)
 
        if (u->age == ts)
        {
-               if (!u->ForceNickChange(u->uuid))
+               if (!u->ChangeNick(u->uuid))
                {
                        ServerInstance->Users->QuitUser(u, "Nickname collision");
                }
index 43fa0f296ec6cb5811a9cd69a56b1e3e77c56720..de13316401697670a997ee84dec96f3949f46675 100644 (file)
@@ -37,10 +37,10 @@ CmdResult CommandSVSNick::Handle(User* user, std::vector<std::string>& parameter
                if (NickTS <= 0)
                        return CMD_FAILURE;
 
-               if (!u->ForceNickChange(nick, NickTS))
+               if (!u->ChangeNick(nick, NickTS))
                {
                        /* buh. UID them */
-                       if (!u->ForceNickChange(u->uuid))
+                       if (!u->ChangeNick(u->uuid))
                        {
                                ServerInstance->Users->QuitUser(u, "Nickname collision");
                        }
index 47dbd2d22ac5fe32a37fcd021d4e46dc43b5c621..3c2043ac12aee6fa2654cc30710ff42d3f4a3699 100644 (file)
@@ -611,7 +611,7 @@ void User::InvalidateCache()
        cached_fullrealhost.clear();
 }
 
-bool User::ChangeNick(const std::string& newnick, bool force, time_t newts)
+bool User::ChangeNick(const std::string& newnick, time_t newts)
 {
        if (quitting)
        {
index c48db51b1dde81ef2f72afd7f69c0dbba67f9aa7..b74fda3cf021152c989d3fa36e0fa495252b5d20 100644 (file)
@@ -641,7 +641,7 @@ bool QLine::Matches(User *u)
 void QLine::Apply(User* u)
 {
        /* Force to uuid on apply of qline, no need to disconnect any more :) */
-       u->ForceNickChange(u->uuid);
+       u->ChangeNick(u->uuid);
 }