* @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
ModeChannelLimit();
ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding);
ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter);
- 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);
};
/** 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 */
{
}
-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);
}
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;
}
}
}
-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()));
}
}
- 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()));
}
ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding)
{
- if (IS_FAKE(source) || (source && ServerInstance->ULine(source->server)))
+ if (IS_SERVER(source) || (source && ServerInstance->ULine(source->server)))
return MODEACTION_ALLOW;
else
{
ModResult OnRawMode(User* user, Channel* chan, const char mode, const std::string ¶m, 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;
}
{
if (channel->IsModeSet('P'))
{
- if (channel->GetUserCounter() == 0 && !IS_FAKE(source))
+ if (channel->GetUserCounter() == 0 && !IS_SERVER(source))
{
/*
* ugh, ugh, UGH!
{
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);
}
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;