1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2010 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
17 #include "treesocket.h"
18 #include "treeserver.h"
22 CmdResult CommandFTopic::Handle(const std::vector<std::string>& params, User *user)
24 time_t ts = atoi(params[1].c_str());
25 Channel* c = ServerInstance->FindChan(params[0]);
28 if ((ts >= c->topicset) || (c->topic.empty()))
30 if (c->topic != params[3])
32 // Update topic only when it differs from current topic
33 c->topic.assign(params[3], 0, ServerInstance->Config->Limits.MaxTopic);
34 c->WriteChannel(user, "TOPIC %s :%s", c->name.c_str(), c->topic.c_str());
37 // Always update setter and settime.
38 c->setby.assign(params[2], 0, 127);