]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Change IS_FAKE and CheckTimeStamp to IS_SERVER and ResolveModeConflict to clarify...
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 26 Sep 2009 16:40:58 +0000 (16:40 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 26 Sep 2009 16:40:58 +0000 (16:40 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11765 e03df62e-2008-0410-955e-edbf42e46eb7

include/mode.h
include/modes/cmode_l.h
include/modules.h
src/mode.cpp
src/modes/cmode_l.cpp
src/modules/m_delaymsg.cpp
src/modules/m_operprefix.cpp
src/modules/m_permchannels.cpp
src/modules/m_spanningtree/main.cpp
src/usermanager.cpp

index e118a161bd10f9f6d9f2a36c33f3ea4e07a839b0..2c0e30be47d14081b286879ae284b706067bd435 100644 (file)
@@ -286,7 +286,7 @@ class CoreExport ModeHandler : public classbase
         * @param channel The channel we are checking against
         * @return True if the other side wins the merge, false if we win the merge for this mode.
         */
-       virtual bool CheckTimeStamp(std::string &their_param, const std::string &our_param, Channel* channel);
+       virtual bool ResolveModeConflict(std::string &their_param, const std::string &our_param, Channel* channel);
 
        /**
         * When a remote server needs to bounce a set of modes, it will call this method for every mode
index 94313ec52d08ba3c1f751d349d6af1e7c86f7e78..d83c4f1cf4ae411fef220b354610a8960752c263 100644 (file)
@@ -23,5 +23,5 @@ class ModeChannelLimit : public ModeHandler
        ModeChannelLimit();
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter);
-       bool CheckTimeStamp(std::string &their_param, const std::string &our_param, Channel* channel);
+       bool ResolveModeConflict(std::string &their_param, const std::string &our_param, Channel* channel);
 };
index d4c54973070381b332d733c30a3d842fa4345de7..63492b8851dbe930df58959db56acb1bc2a2fab0 100644 (file)
@@ -216,7 +216,7 @@ do { \
 /** Is a remote user */
 #define IS_REMOTE(x) (x->GetFd() < 0)
 /** Is a fake user */
-#define IS_FAKE(x) (x->GetFd() == FD_FAKEUSER_NUMBER)
+#define IS_SERVER(x) (x->GetFd() == FD_FAKEUSER_NUMBER)
 /** Is a module created user */
 #define IS_MODULE_CREATED(x) (x->GetFd() == FD_MAGIC_NUMBER)
 /** Is an oper */
index 4478dce73df3f09981da9f200a06b01182572679..965619eea490dad84b951d91cbf7bf23145a6e2c 100644 (file)
@@ -138,7 +138,7 @@ void ModeHandler::OnParameterMissing(User* user, User* dest, Channel* channel)
 {
 }
 
-bool ModeHandler::CheckTimeStamp(std::string& theirs, const std::string& ours, Channel*)
+bool ModeHandler::ResolveModeConflict(std::string& theirs, const std::string& ours, Channel*)
 {
        return (theirs < ours);
 }
@@ -450,7 +450,7 @@ void ModeParser::Process(const std::vector<std::string>& parameters, User *user,
                        if (merge && targetchannel && targetchannel->IsModeSet(modechar) && !mh->IsListMode())
                        {
                                std::string ours = targetchannel->GetModeParameter(modechar);
-                               if (!mh->CheckTimeStamp(parameter, ours, targetchannel))
+                               if (!mh->ResolveModeConflict(parameter, ours, targetchannel))
                                        /* we won the mode merge, don't apply this mode */
                                        continue;
                        }
index aa713ec560d1ad95f7ffaaf17bb0968d16236778..d177150b65e55e22efc141e4d9935807668fbfc0 100644 (file)
@@ -34,7 +34,7 @@ ModePair ModeChannelLimit::ModeSet(User*, User*, Channel* channel, const std::st
        }
 }
 
-bool ModeChannelLimit::CheckTimeStamp(std::string &their_param, const std::string &our_param, Channel*)
+bool ModeChannelLimit::ResolveModeConflict(std::string &their_param, const std::string &our_param, Channel*)
 {
        /* When TS is equal, the higher channel limit wins */
        return (atoi(their_param.c_str()) < atoi(our_param.c_str()));
index 7931a598204445b74f1c05ffb1106a4ac327ef1a..77ac5fc59a80024d01e65d1e8c55aae84bb4e5b3 100644 (file)
@@ -41,7 +41,7 @@ class DelayMsgMode : public ModeHandler
                }
        }
 
-       bool CheckTimeStamp(std::string &their_param, const std::string &our_param, Channel*)
+       bool ResolveModeConflict(std::string &their_param, const std::string &our_param, Channel*)
        {
                return (atoi(their_param.c_str()) < atoi(our_param.c_str()));
        }
index 10dcdb37d295178b5705508dfa6957d3a898da17..223768dac8d92b681dc94d75c8c4f47ea787462d 100644 (file)
@@ -39,7 +39,7 @@ class OperPrefixMode : public ModeHandler
 
                ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
                {
-                       if (IS_FAKE(source) || (source && ServerInstance->ULine(source->server)))
+                       if (IS_SERVER(source) || (source && ServerInstance->ULine(source->server)))
                                return MODEACTION_ALLOW;
                        else
                        {
@@ -110,7 +110,7 @@ class ModuleOperPrefixMode : public Module
        ModResult OnRawMode(User* user, Channel* chan, const char mode, const std::string &param, bool adding, int pcnt)
        {
                /* force event propagation to its ModeHandler */
-               if (!IS_FAKE(user) && chan && (mode == 'y'))
+               if (!IS_SERVER(user) && chan && (mode == 'y'))
                        return MOD_RES_ALLOW;
                return MOD_RES_PASSTHRU;
        }
index 3e2e18a8e73abf6f9b14d4bf2e0960cc1afead01..a409078e4ab29eb5c41bb940ae156e6ede168c34 100644 (file)
@@ -135,7 +135,7 @@ class PermChannel : public ModeHandler
                {
                        if (channel->IsModeSet('P'))
                        {
-                               if (channel->GetUserCounter() == 0 && !IS_FAKE(source))
+                               if (channel->GetUserCounter() == 0 && !IS_SERVER(source))
                                {
                                        /*
                                         * ugh, ugh, UGH!
index 31d0ec449e1bc9fde06e726c800bafe21e7c9447..e3ed9fca29b2c9f1cd7f8225db8afe2a90cfc8c1 100644 (file)
@@ -718,7 +718,7 @@ void ModuleSpanningTree::OnUserKick(User* source, Membership* memb, const std::s
        {
                Utils->DoOneToMany(source->uuid,"KICK",params);
        }
-       else if (IS_FAKE(source) && source != Utils->ServerUser)
+       else if (IS_SERVER(source) && source != Utils->ServerUser)
        {
                Utils->DoOneToMany(ServerInstance->Config->GetSID(),"KICK",params);
        }
index db2d3b08e6a55899950fe513d486711b38b243af..b355bc890ce32e2ff10f1f00a029d5421310e487 100644 (file)
@@ -171,7 +171,7 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char
                return;
        }
 
-       if (IS_FAKE(user))
+       if (IS_SERVER(user))
        {
                ServerInstance->Logs->Log("CULLLIST",DEBUG, "*** Warning *** - You tried to quit a fake user (%s)", user->nick.c_str());
                return;