#include "configreader.h"
#include "users.h"
#include "modules.h"
-#include "message.h"
#include "commands.h"
#include "commands/cmd_topic.h"
-#include "helperfuncs.h"
-extern InspIRCd* ServerInstance;
-extern int MODCOUNT;
-extern time_t TIME;
-extern ModuleList modules;
-extern FactoryList factory;
void cmd_topic::Handle (const char** parameters, int pcnt, userrec *user)
{
if (pcnt == 1)
{
- Ptr = FindChan(parameters[0]);
+ Ptr = ServerInstance->FindChan(parameters[0]);
if (Ptr)
{
if ((Ptr->modes[CM_SECRET]) && (!Ptr->HasUser(user)))
}
else if (pcnt>1)
{
- Ptr = FindChan(parameters[0]);
+ Ptr = ServerInstance->FindChan(parameters[0]);
if (Ptr)
{
if (IS_LOCAL(user))
user->WriteServ("442 %s %s :You're not on that channel!",user->nick, Ptr->name);
return;
}
- if ((Ptr->modes[CM_TOPICLOCK]) && (cstatus(user,Ptr)<STATUS_HOP))
+ if ((Ptr->modes[CM_TOPICLOCK]) && (Ptr->GetStatus(user) < STATUS_HOP))
{
user->WriteServ("482 %s %s :You must be at least a half-operator to change modes on this channel", user->nick, Ptr->name);
return;
strlcpy(Ptr->topic,topic,MAXTOPIC-1);
strlcpy(Ptr->setby,user->nick,NICKMAX-1);
- Ptr->topicset = TIME;
+ Ptr->topicset = ServerInstance->Time();
Ptr->WriteChannel(user, "TOPIC %s :%s", Ptr->name, Ptr->topic);
if (IS_LOCAL(user))
{