]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_privmsg.cpp
Move some stuff around so the last penalty line doesnt get held erroneously until...
[user/henk/code/inspircd.git] / src / cmd_privmsg.cpp
index 04f5009519b0e8ad53a3d5920e513b0685b2ac19..fddf810d2846ba01ffe2e74b358aa3f570672385 100644 (file)
  */
 
 #include "inspircd.h"
-#include "configreader.h"
-#include "users.h"
-#include "modules.h"
 #include "wildcard.h"
 #include "commands/cmd_privmsg.h"
 
-extern "C" DllExport  command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport  Command* init_command(InspIRCd* Instance)
 {
        return new cmd_privmsg(Instance);
 }
 
-CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user)
+CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, User *user)
 {
-       userrec *dest;
-       chanrec *chan;
+       User *dest;
+       Channel *chan;
        CUList except_list;
 
        user->idle_lastmsg = ServerInstance->Time();
@@ -121,7 +118,11 @@ CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user)
                return CMD_SUCCESS;
        }
 
-       dest = ServerInstance->FindNick(parameters[0]);
+       if (IS_LOCAL(user))
+               dest = ServerInstance->FindNickOnly(parameters[0]);
+       else
+               dest = ServerInstance->FindNick(parameters[0]);
+
        if (dest)
        {
                if (!*parameters[1])