]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_topic.cpp
Spotted problem: must clear out all prefixes attached to a user when they quit or...
[user/henk/code/inspircd.git] / src / cmd_topic.cpp
index 1d4d040f55dcd63f64be616253b0539e265d4a21..1939af7b23cf78bebd6258ac55453a3ded0d8f33 100644 (file)
 #include "configreader.h"
 #include "users.h"
 #include "modules.h"
-#include "message.h"
 #include "commands.h"
 #include "commands/cmd_topic.h"
-#include "helperfuncs.h"
 
-extern ServerConfig* Config;
-extern int MODCOUNT;
-extern time_t TIME;
-extern ModuleList modules;
-extern FactoryList factory;
 
 void cmd_topic::Handle (const char** parameters, int pcnt, userrec *user)
 {
@@ -35,7 +28,7 @@ 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)))
@@ -61,7 +54,7 @@ void cmd_topic::Handle (const char** parameters, int pcnt, userrec *user)
        }
        else if (pcnt>1)
        {
-               Ptr = FindChan(parameters[0]);
+               Ptr = ServerInstance->FindChan(parameters[0]);
                if (Ptr)
                {
                        if (IS_LOCAL(user))
@@ -71,7 +64,7 @@ void cmd_topic::Handle (const char** parameters, int pcnt, userrec *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;
@@ -90,7 +83,7 @@ void cmd_topic::Handle (const char** parameters, int pcnt, userrec *user)
 
                        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))
                        {