]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_invite.cpp
Rename <connect:nouserdns> to <connect:resolvehostnames>.
[user/henk/code/inspircd.git] / src / commands / cmd_invite.cpp
index 6e5aead123d9525698aa3316c0daeb90468cf528..2ed05c550033c8344cd430c4ad408a7df8f2ebee 100644 (file)
@@ -40,6 +40,10 @@ class CommandInvite : public Command
         * @return A value from CmdResult to indicate command success or failure.
         */
        CmdResult Handle(const std::vector<std::string>& parameters, User *user);
+       RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+       {
+               return (IS_LOCAL(user) ? ROUTE_LOCALONLY : ROUTE_BROADCAST);
+       }
 };
 
 /** Handle /INVITE
@@ -72,16 +76,16 @@ CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, Use
                        return CMD_FAILURE;
                }
 
-               if (c->HasUser(u))
-               {
-                       user->WriteNumeric(ERR_USERONCHANNEL, "%s %s %s :is already on channel",user->nick.c_str(),u->nick.c_str(),c->name.c_str());
-                       return CMD_FAILURE;
-               }
-
                if ((IS_LOCAL(user)) && (!c->HasUser(user)))
-               {
+               {
                        user->WriteNumeric(ERR_NOTONCHANNEL, "%s %s :You're not on that channel!",user->nick.c_str(), c->name.c_str());
-                       return CMD_FAILURE;
+                       return CMD_FAILURE;
+               }
+
+               if (c->HasUser(u))
+               {
+                       user->WriteNumeric(ERR_USERONCHANNEL, "%s %s %s :is already on channel",user->nick.c_str(),u->nick.c_str(),c->name.c_str());
+                       return CMD_FAILURE;
                }
 
                FIRST_MOD_RESULT(OnUserPreInvite, MOD_RESULT, (user,u,c,timeout));
@@ -139,7 +143,7 @@ CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, Use
                        }
                        c->WriteAllExceptSender(user, true, prefix, "NOTICE %s :*** %s invited %s into the channel", c->name.c_str(), user->nick.c_str(), u->nick.c_str());
                }
-               FOREACH_MOD(I_OnUserInvite,OnUserInvite(user,u,c,timeout));
+               FOREACH_MOD(OnUserInvite, (user,u,c,timeout));
        }
        else if (IS_LOCAL(user))
        {