mirror of
https://github.com/anope/anope.git
synced 2026-07-10 15:03:13 +02:00
Fixed some stuff spotted by Cronus, made db_old convert ACCESS_INVALID levels to ACCESS_FOUNDER, fix cs_enforce +R from an earlier commit, fixed ChangeModeInternal TS checking when IRCds don't send TS on mode
This commit is contained in:
+1
-1
@@ -205,7 +205,7 @@ class CoreExport Channel : public virtual Base, public Extensible, public Flags<
|
||||
* @param mode the modes
|
||||
* @param EnforceMLock true to enforce mlock
|
||||
*/
|
||||
void SetModesInternal(MessageSource &source, const Anope::string &mode, time_t ts = Anope::CurTime, bool EnforceMLock = true);
|
||||
void SetModesInternal(MessageSource &source, const Anope::string &mode, time_t ts = 0, bool EnforceMLock = true);
|
||||
|
||||
/** Kick a user from a channel internally
|
||||
* @param source The sender of the kick
|
||||
|
||||
@@ -114,7 +114,7 @@ class CommandCSEnforce : public Command
|
||||
Log(LOG_COMMAND, source, this) << "to enforce registered only";
|
||||
|
||||
std::vector<User *> users;
|
||||
for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; )
|
||||
for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; ++it)
|
||||
{
|
||||
UserContainer *uc = *it;
|
||||
User *user = uc->user;
|
||||
|
||||
@@ -771,6 +771,9 @@ static void LoadChannels()
|
||||
int16_t level;
|
||||
READ(read_int16(&level, f));
|
||||
|
||||
if (level == ACCESS_INVALID)
|
||||
level = ACCESS_FOUNDER;
|
||||
|
||||
ci->SetLevel(GetLevelName(j), level);
|
||||
}
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ struct IRCDMessageMode : IRCDMessage
|
||||
if (params.size() > 2 && ircdproto->IsChannelValid(params[0]))
|
||||
{
|
||||
Channel *c = findchan(params[0]);
|
||||
time_t ts = Anope::CurTime;
|
||||
time_t ts = 0;
|
||||
try
|
||||
{
|
||||
ts = convertTo<time_t>(params[1]);
|
||||
|
||||
@@ -316,7 +316,7 @@ struct IRCDMessageMode : IRCDMessage
|
||||
if (params.size() > 2 && ircdproto->IsChannelValid(params[0]))
|
||||
{
|
||||
Channel *c = findchan(params[0]);
|
||||
time_t ts = Anope::CurTime;
|
||||
time_t ts = 0;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -546,7 +546,7 @@ struct IRCDMessageTMode : IRCDMessage
|
||||
|
||||
bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
time_t ts = Anope::CurTime;
|
||||
time_t ts = 0;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -516,7 +516,7 @@ struct IRCDMessageFMode : IRCDMessage
|
||||
}
|
||||
catch (const ConvertException &)
|
||||
{
|
||||
ts = Anope::CurTime;
|
||||
ts = 0;
|
||||
}
|
||||
|
||||
if (c)
|
||||
@@ -680,7 +680,7 @@ struct IRCDMessageMode : IRCDMessage
|
||||
modes += " " + params[n];
|
||||
|
||||
if (c)
|
||||
c->SetModesInternal(source, modes, Anope::CurTime);
|
||||
c->SetModesInternal(source, modes);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -783,7 +783,7 @@ struct IRCDMessageMode : IRCDMessage
|
||||
}
|
||||
catch (const ConvertException &)
|
||||
{
|
||||
ts = Anope::CurTime;
|
||||
ts = 0;
|
||||
}
|
||||
|
||||
if (c)
|
||||
|
||||
@@ -255,7 +255,7 @@ struct IRCDMessageChaninfo : IRCDMessage
|
||||
c->ChangeTopicInternal(source.GetName(), params[4], Anope::CurTime);
|
||||
}
|
||||
|
||||
c->SetModesInternal(source, modes, c->creation_time, true);
|
||||
c->SetModesInternal(source, modes);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -302,7 +302,7 @@ struct IRCDMessageJoin : IRCDMessage
|
||||
chan->JoinUser(user);
|
||||
|
||||
if (!modes.empty())
|
||||
chan->SetModesInternal(source, modes, chan->creation_time);
|
||||
chan->SetModesInternal(source, modes);
|
||||
|
||||
/* Set the proper modes on the user */
|
||||
chan_set_correct_modes(user, chan, 1, true);
|
||||
@@ -353,7 +353,7 @@ struct IRCDMessageMode : IRCDMessage
|
||||
Channel *c = findchan(params[0]);
|
||||
|
||||
if (c)
|
||||
c->SetModesInternal(source, modes, c->creation_time);
|
||||
c->SetModesInternal(source, modes);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -358,7 +358,7 @@ struct IRCDMessageMode : IRCDMessage
|
||||
{
|
||||
// 0 = channel, 1 = ts, 2 = modes
|
||||
Channel *c = findchan(params[0]);
|
||||
time_t ts = Anope::CurTime;
|
||||
time_t ts = 0;
|
||||
try
|
||||
{
|
||||
ts = convertTo<time_t>(params[1]);
|
||||
@@ -567,7 +567,7 @@ struct IRCDMessageTMode : IRCDMessage
|
||||
|
||||
bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
time_t ts = Anope::CurTime;
|
||||
time_t ts = 0;
|
||||
try
|
||||
{
|
||||
ts = convertTo<time_t>(params[0]);
|
||||
|
||||
@@ -303,7 +303,7 @@ struct IRCDMessageMode : IRCDMessage
|
||||
{
|
||||
Channel *c = findchan(params[0]);
|
||||
if (c)
|
||||
c->SetModesInternal(source, params[1], Anope::CurTime);
|
||||
c->SetModesInternal(source, params[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -507,7 +507,7 @@ struct IRCDMessageTMode : IRCDMessage
|
||||
|
||||
bool Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
time_t ts = Anope::CurTime;
|
||||
time_t ts = 0;
|
||||
try
|
||||
{
|
||||
ts = convertTo<time_t>(params[0]);
|
||||
|
||||
@@ -702,7 +702,7 @@ struct IRCDMessageMode : IRCDMessage
|
||||
if (ircdproto->IsChannelValid(params[0]))
|
||||
{
|
||||
Channel *c = findchan(params[0]);
|
||||
time_t ts = Anope::CurTime;
|
||||
time_t ts = 0;
|
||||
try
|
||||
{
|
||||
if (server_source)
|
||||
|
||||
+3
-1
@@ -714,7 +714,9 @@ void Channel::SetModesInternal(MessageSource &source, const Anope::string &mode,
|
||||
++this->server_modecount;
|
||||
}
|
||||
|
||||
if (ts > this->creation_time)
|
||||
if (!ts)
|
||||
;
|
||||
else if (ts > this->creation_time)
|
||||
return;
|
||||
else if (ts < this->creation_time)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user