]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modes/cmode_o.cpp
Move IsNick, IsIdent into class InspIRCd, update modules that use it.
[user/henk/code/inspircd.git] / src / modes / cmode_o.cpp
index 22d95d5a9fec4a824f8aadf57de35993ab60e77f..75e088635bc9c9d2a9fd62fdc95d46d5764e4d20 100644 (file)
@@ -8,7 +8,6 @@
 #include "channels.h"
 #include "users.h"
 #include "helperfuncs.h"
-#include "message.h"
 #include "commands.h"
 #include "modules.h"
 #include "inspstring.h"
@@ -16,7 +15,7 @@
 #include "modes/cmode_o.h"
 
 extern InspIRCd* ServerInstance;
-extern ServerConfig* Config;
+
 extern std::vector<Module*> modules;
 extern std::vector<ircd_module*> factory;
 extern int MODCOUNT;
@@ -28,24 +27,24 @@ ModeChannelOp::ModeChannelOp() : ModeHandler('o', 1, 1, true, MODETYPE_CHANNEL,
 
 ModePair ModeChannelOp::ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter)
 {
-        userrec* x = Find(parameter);
-        if (x)
-        {
-                if (cstatus(x, channel) == STATUS_OP)
-                {
-                        return std::make_pair(true, x->nick);
-                }
-                else
-                {
-                        return std::make_pair(false, parameter);
-                }
-        }
+       userrec* x = ServerInstance->FindNick(parameter);
+       if (x)
+       {
+               if (channel->GetStatus(x) == STATUS_OP)
+               {
+                       return std::make_pair(true, x->nick);
+               }
+               else
+               {
+                       return std::make_pair(false, parameter);
+               }
+       }
        return std::make_pair(false, parameter);
 }
 
 ModeAction ModeChannelOp::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
 {
-       int status = cstatus(source, channel);
+       int status = channel->GetStatus(source);
 
        /* Call the correct method depending on wether we're adding or removing the mode */
        if (adding)