1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 03:23:13 +02:00

Fix the handling of topic messages with InspIRCd v3.

This commit is contained in:
Matt Schatz
2020-03-25 19:22:22 -06:00
committed by Sadie Powell
parent 4d101569f8
commit 0d0763f72f
+7 -3
View File
@@ -1528,15 +1528,19 @@ struct IRCDMessageFMode : IRCDMessage
struct IRCDMessageFTopic : IRCDMessage
{
IRCDMessageFTopic(Module *creator) : IRCDMessage(creator, "FTOPIC", 5) { }
IRCDMessageFTopic(Module *creator) : IRCDMessage(creator, "FTOPIC", 4) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
/* :source FTOPIC channel ts topicts setby :topic */
// :source FTOPIC channel ts topicts :topic
// :source FTOPIC channel ts topicts setby :topic (burst or RESYNC)
const Anope::string &setby = params.size() > 4 ? params[3] : source.GetName();
const Anope::string &topic = params.size() > 4 ? params[4] : params[3];
Channel *c = Channel::Find(params[0]);
if (c)
c->ChangeTopicInternal(NULL, params[3], params[4], params[2].is_pos_number_only() ? convertTo<time_t>(params[2]) : Anope::CurTime);
c->ChangeTopicInternal(NULL, setby, topic, params[2].is_pos_number_only() ? convertTo<time_t>(params[2]) : Anope::CurTime);
}
};