summaryrefslogtreecommitdiff
path: root/modules/core
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-09-15 16:40:55 -0400
committerAdam <Adam@anope.org>2010-09-15 16:40:55 -0400
commit813185105823daa6a1b574d86053950382343589 (patch)
tree793d4f54cddc88275b4372839f93bba01301b427 /modules/core
parent6239b5a053fc8fd94b798495f8e189a2e2bda285 (diff)
Rewrote all of the topic code, fixes a few topic related problems on some older IRCds
Diffstat (limited to 'modules/core')
-rw-r--r--modules/core/cs_topic.cpp26
1 files changed, 6 insertions, 20 deletions
diff --git a/modules/core/cs_topic.cpp b/modules/core/cs_topic.cpp
index 98ca4a2ac..fbb9a23f4 100644
--- a/modules/core/cs_topic.cpp
+++ b/modules/core/cs_topic.cpp
@@ -34,28 +34,14 @@ class CommandCSTopic : public Command
notice_lang(Config->s_ChanServ, u, ACCESS_DENIED);
else
{
- ci->last_topic = topic;
- ci->last_topic_setter = u->nick;
- ci->last_topic_time = Anope::CurTime;
-
- c->topic = topic;
- c->topic_setter = u->nick;
- if (ircd->topictsbackward)
- c->topic_time = c->topic_time - 1;
- else
- c->topic_time = ci->last_topic_time;
-
+ bool has_topiclock = ci->HasFlag(CI_TOPICLOCK);
+ ci->UnsetFlag(CI_TOPICLOCK);
+ c->ChangeTopic(u->nick, topic, Anope::CurTime);
+ if (has_topiclock)
+ ci->SetFlag(CI_TOPICLOCK);
+
bool override = !check_access(u, ci, CA_TOPIC);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to change the topic to " << (!topic.empty() ? topic : "No topic");
-
- if (ircd->join2set && whosends(ci) == ChanServ) // XXX what if the service bot is chanserv?
- {
- ChanServ->Join(c);
- ircdproto->SendMode(NULL, c, "+o %s", Config->s_ChanServ.c_str()); // XXX
- }
- ircdproto->SendTopic(whosends(ci), c, u->nick, topic);
- if (ircd->join2set && whosends(ci) == ChanServ)
- ChanServ->Part(c);
}
return MOD_CONT;
}