]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_privmsg.cpp
Change OnHookUserIO to OnHookIO, making it usable for more than User* and less picky...
[user/henk/code/inspircd.git] / src / commands / cmd_privmsg.cpp
index 13c81a5a1a3ed4ccb9d0f300cecad0ad8d63a744..5c6e462c8b767c90ece309d94eccbfb6b16f6748 100644 (file)
@@ -3,7 +3,7 @@
  *       +------------------------------------+
  *
  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
@@ -26,7 +26,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us
        CUList except_list;
 
        user->idle_lastmsg = ServerInstance->Time();
-       
+
        if (ServerInstance->Parser->LoopCall(user, this, parameters, 0))
                return CMD_SUCCESS;
 
@@ -120,7 +120,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us
                                        chan->WriteAllExcept(user, false, status, except_list, "PRIVMSG %c%s :%s", status, chan->name.c_str(), text);
                                }
                        }
-                       else 
+                       else
                        {
                                chan->WriteAllExcept(user, false, status, except_list, "PRIVMSG %s :%s", chan->name.c_str(), text);
                        }
@@ -141,12 +141,12 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us
        if (IS_LOCAL(user))
        {
                const char* targetserver = strchr(destnick, '@');
-       
+
                if (targetserver)
                {
                        std::string nickonly;
 
-                       nickonly.assign(destnick, 0, targetserver - destnick + 1);
+                       nickonly.assign(destnick, 0, targetserver - destnick);
                        dest = ServerInstance->FindNickOnly(nickonly);
                        if (dest && strcasecmp(dest->server, targetserver + 1))
                        {
@@ -176,7 +176,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us
                }
 
                int MOD_RESULT = 0;
-               
+
                std::string temp = parameters[1];
                FOREACH_RESULT(I_OnUserPreMessage,OnUserPreMessage(user, dest, TYPE_USER, temp, 0, except_list));
                if (MOD_RESULT) {
@@ -202,4 +202,3 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us
        }
        return CMD_SUCCESS;
 }
-