summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp10
-rw-r--r--src/regchannel.cpp2
2 files changed, 8 insertions, 4 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index c95e46373..be3915b46 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -41,7 +41,7 @@ Channel::Channel(const Anope::string &nname, time_t ts) : Flags<ChannelFlag, 3>(
this->creation_time = ts;
this->server_modetime = this->chanserv_modetime = 0;
- this->server_modecount = this->chanserv_modecount = this->bouncy_modes = this->topic_time = 0;
+ this->server_modecount = this->chanserv_modecount = this->bouncy_modes = this->topic_ts = this->topic_time = 0;
this->ci = cs_findchan(this->name);
if (this->ci)
@@ -896,7 +896,8 @@ void Channel::ChangeTopicInternal(const Anope::string &user, const Anope::string
this->topic = newtopic;
this->topic_setter = u ? u->nick : user;
- this->topic_time = ts;
+ this->topic_ts = ts;
+ this->topic_time = Anope::CurTime;
Log(LOG_DEBUG) << "Topic of " << this->name << " changed by " << (u ? u->nick : user) << " to " << newtopic;
@@ -912,10 +913,13 @@ void Channel::ChangeTopic(const Anope::string &user, const Anope::string &newtop
this->topic = newtopic;
this->topic_setter = u ? u->nick : user;
- this->topic_time = ts;
+ this->topic_ts = ts;
ircdproto->SendTopic(this->ci->WhoSends(), this);
+ /* Now that the topic is set update the time set. This is *after* we set it so the protocol modules are able to tell the old last set time */
+ this->topic_time = Anope::CurTime;
+
FOREACH_MOD(I_OnTopicUpdated, OnTopicUpdated(this, user, this->topic));
if (this->ci)
diff --git a/src/regchannel.cpp b/src/regchannel.cpp
index e0f371117..1e0014454 100644
--- a/src/regchannel.cpp
+++ b/src/regchannel.cpp
@@ -1134,7 +1134,7 @@ void ChannelInfo::CheckTopic()
{
this->last_topic = this->c->topic;
this->last_topic_setter = this->c->topic_setter;
- this->last_topic_time = this->c->topic_time;
+ this->last_topic_time = this->c->topic_ts;
}
}