mirror of
https://github.com/anope/anope.git
synced 2026-07-05 01:13:12 +02:00
Remove time from the name of some variables where its obvious.
This commit is contained in:
+6
-6
@@ -30,7 +30,7 @@ std::vector<Channel *> Channel::deleting;
|
||||
|
||||
Channel::Channel(const Anope::string &nname, time_t ts)
|
||||
: name(nname)
|
||||
, creation_time(ts)
|
||||
, created(ts)
|
||||
{
|
||||
if (nname.empty())
|
||||
throw CoreException("A channel without a name ?");
|
||||
@@ -610,15 +610,15 @@ void Channel::SetModesInternal(MessageSource &source, const Anope::string &modes
|
||||
{
|
||||
if (!ts)
|
||||
;
|
||||
else if (ts > this->creation_time)
|
||||
else if (ts > this->created)
|
||||
{
|
||||
Log(LOG_DEBUG) << "Dropping mode " << modes << " on " << this->name << ", " << ts << " > " << this->creation_time;
|
||||
Log(LOG_DEBUG) << "Dropping mode " << modes << " on " << this->name << ", " << ts << " > " << this->created;
|
||||
return;
|
||||
}
|
||||
else if (ts < this->creation_time)
|
||||
else if (ts < this->created)
|
||||
{
|
||||
Log(LOG_DEBUG) << "Changing TS of " << this->name << " from " << this->creation_time << " to " << ts;
|
||||
this->creation_time = ts;
|
||||
Log(LOG_DEBUG) << "Changing TS of " << this->name << " from " << this->created << " to " << ts;
|
||||
this->created = ts;
|
||||
this->Reset();
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -110,7 +110,7 @@ void Join::Run(MessageSource &source, const std::vector<Anope::string> ¶ms,
|
||||
users.emplace_back(ChannelStatus(), user);
|
||||
|
||||
Channel *chan = Channel::Find(channel);
|
||||
SJoin(source, channel, chan ? chan->creation_time : Anope::CurTime, "", {}, users);
|
||||
SJoin(source, channel, chan ? chan->created : Anope::CurTime, "", {}, users);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,13 +126,13 @@ void Join::SJoin(MessageSource &source, const Anope::string &chan, time_t ts, co
|
||||
else if (!ts)
|
||||
;
|
||||
/* Our creation time is newer than what the server gave us, so reset the channel to the older time */
|
||||
else if (c->creation_time > ts)
|
||||
else if (c->created > ts)
|
||||
{
|
||||
c->creation_time = ts;
|
||||
c->created = ts;
|
||||
c->Reset();
|
||||
}
|
||||
/* Their TS is newer, don't accept any modes from them */
|
||||
else if (ts > c->creation_time)
|
||||
else if (ts > c->created)
|
||||
keep_their_modes = false;
|
||||
|
||||
/* Update the modes for the channel */
|
||||
@@ -144,7 +144,7 @@ void Join::SJoin(MessageSource &source, const Anope::string &chan, time_t ts, co
|
||||
|
||||
for (const auto &[status, u] : users)
|
||||
{
|
||||
keep_their_modes = ts <= c->creation_time; // OnJoinChannel can call modules which can modify this channel's ts
|
||||
keep_their_modes = ts <= c->created; // OnJoinChannel can call modules which can modify this channel's ts
|
||||
|
||||
if (c->FindUser(u))
|
||||
continue;
|
||||
|
||||
+4
-4
@@ -158,7 +158,7 @@ void NickAlias::Type::Serialize(const Serializable *obj, Serialize::Data &data)
|
||||
data.Store("last_realname", na->last_realname);
|
||||
data.Store("last_usermask", na->last_usermask);
|
||||
data.Store("last_realhost", na->last_realhost);
|
||||
data.Store("time_registered", na->time_registered);
|
||||
data.Store("time_registered", na->registered);
|
||||
data.Store("last_seen", na->last_seen);
|
||||
data.Store("ncid", na->nc->GetId());
|
||||
|
||||
@@ -211,7 +211,7 @@ Serializable *NickAlias::Type::Unserialize(Serializable *obj, Serialize::Data &d
|
||||
data["last_realname"] >> na->last_realname;
|
||||
data["last_usermask"] >> na->last_usermask;
|
||||
data["last_realhost"] >> na->last_realhost;
|
||||
data["time_registered"] >> na->time_registered;
|
||||
data["time_registered"] >> na->registered;
|
||||
data["last_seen"] >> na->last_seen;
|
||||
|
||||
Anope::string vhost_ident, vhost_host, vhost_creator;
|
||||
@@ -233,8 +233,8 @@ Serializable *NickAlias::Type::Unserialize(Serializable *obj, Serialize::Data &d
|
||||
if (b)
|
||||
na->Extend<bool>("NS_NO_EXPIRE");
|
||||
|
||||
if (na->time_registered < na->nc->time_registered)
|
||||
na->nc->time_registered = na->time_registered;
|
||||
if (na->registered < na->nc->registered)
|
||||
na->nc->registered = na->registered;
|
||||
/* end compat */
|
||||
|
||||
return na;
|
||||
|
||||
+3
-3
@@ -80,7 +80,7 @@ void NickCore::Type::Serialize(const Serializable *obj, Serialize::Data &data) c
|
||||
data.Store("email", nc->email);
|
||||
data.Store("language", nc->language);
|
||||
data.Store("lastmail", nc->lastmail);
|
||||
data.Store("time_registered", nc->time_registered);
|
||||
data.Store("time_registered", nc->registered);
|
||||
data.Store("memomax", nc->memos.memomax);
|
||||
|
||||
std::ostringstream oss;
|
||||
@@ -110,7 +110,7 @@ Serializable *NickCore::Type::Unserialize(Serializable *obj, Serialize::Data &da
|
||||
data["email"] >> nc->email;
|
||||
data["language"] >> nc->language;
|
||||
data["lastmail"] >> nc->lastmail;
|
||||
data["time_registered"] >> nc->time_registered;
|
||||
data["time_registered"] >> nc->registered;
|
||||
data["memomax"] >> nc->memos.memomax;
|
||||
{
|
||||
Anope::string buf;
|
||||
@@ -259,7 +259,7 @@ uint64_t NickCore::GetId()
|
||||
uint64_t attempt = 0;
|
||||
while (!this->id)
|
||||
{
|
||||
const auto newidstr = this->display + "\0" + Anope::ToString(this->time_registered) + "\0" + Anope::ToString(attempt++);
|
||||
const auto newidstr = this->display + "\0" + Anope::ToString(this->registered) + "\0" + Anope::ToString(attempt++);
|
||||
const auto newid = Anope::hash_cs()(newidstr);
|
||||
if (NickCoreIdList->emplace(newid, this).second)
|
||||
{
|
||||
|
||||
+3
-3
@@ -109,7 +109,7 @@ ChannelInfo::ChannelInfo(const Anope::string &chname)
|
||||
, access(CHANACCESS_TYPE)
|
||||
, akick(AUTOKICK_TYPE)
|
||||
, name(chname)
|
||||
, time_registered(Anope::CurTime)
|
||||
, registered(Anope::CurTime)
|
||||
, last_used(Anope::CurTime)
|
||||
{
|
||||
if (chname.empty())
|
||||
@@ -196,7 +196,7 @@ void ChannelInfo::Type::Serialize(const Serializable *obj, Serialize::Data &data
|
||||
if (ci->successor)
|
||||
data.Store("successorid", ci->successor->GetId());
|
||||
data.Store("description", ci->desc);
|
||||
data.Store("time_registered", ci->time_registered);
|
||||
data.Store("registered", ci->registered);
|
||||
data.Store("last_used", ci->last_used);
|
||||
data.Store("last_topic", ci->last_topic);
|
||||
data.Store("last_topic_setter", ci->last_topic_setter);
|
||||
@@ -244,7 +244,7 @@ Serializable *ChannelInfo::Type::Unserialize(Serializable *obj, Serialize::Data
|
||||
ci->SetSuccessor(ssuccessorid ? NickCore::FindId(ssuccessorid) : NickCore::Find(ssuccessor));
|
||||
|
||||
data["description"] >> ci->desc;
|
||||
data["time_registered"] >> ci->time_registered;
|
||||
data["registered"] >> ci->registered;
|
||||
data["last_used"] >> ci->last_used;
|
||||
data["last_topic"] >> ci->last_topic;
|
||||
data["last_topic_setter"] >> ci->last_topic_setter;
|
||||
|
||||
Reference in New Issue
Block a user