]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sakick.cpp
stripcolor now strips from part messages (#1175)
[user/henk/code/inspircd.git] / src / modules / m_sakick.cpp
index 3dd7ed3d1ca8654f6480e90b0972eb762d1b7af0..ab168ca680d1558a522a3c1821a98b2a17fd661e 100644 (file)
@@ -35,22 +35,14 @@ class CommandSakick : public Command
        {
                User* dest = ServerInstance->FindNick(parameters[1]);
                Channel* channel = ServerInstance->FindChan(parameters[0]);
-               const char* reason = "";
 
                if ((dest) && (dest->registered == REG_ALL) && (channel))
                {
-                       if (parameters.size() > 2)
-                       {
-                               reason = parameters[2].c_str();
-                       }
-                       else
-                       {
-                               reason = dest->nick.c_str();
-                       }
+                       const std::string& reason = (parameters.size() > 2) ? parameters[2] : dest->nick;
 
-                       if (ServerInstance->ULine(dest->server))
+                       if (dest->server->IsULine())
                        {
-                               user->WriteNumeric(ERR_NOPRIVILEGES, ":Cannot use an SA command on a u-lined client");
+                               user->WriteNumeric(ERR_NOPRIVILEGES, "Cannot use an SA command on a u-lined client");
                                return CMD_FAILURE;
                        }
 
@@ -83,10 +75,7 @@ class CommandSakick : public Command
 
        RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
        {
-               User* dest = ServerInstance->FindNick(parameters[1]);
-               if (dest)
-                       return ROUTE_OPT_UCAST(dest->server);
-               return ROUTE_LOCALONLY;
+               return ROUTE_OPT_UCAST(parameters[1]);
        }
 };