]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_userhost.cpp
cmd_lusers Convert to a module
[user/henk/code/inspircd.git] / src / commands / cmd_userhost.cpp
index c19ad5b6f4be657b955b56d2d529cbd013cd6bf8..399de0b1a21d8dff83fbd73e4078d4bcde8045ba 100644 (file)
 
 #include "inspircd.h"
 
-#ifndef CMD_USERHOST_H
-#define CMD_USERHOST_H
-
-// include the common header files
-
-#include "users.h"
-#include "channels.h"
-
 /** Handle /USERHOST. These command handlers can be reloaded by the core,
  * and handle basic RFC1459 commands. Commands within modules work
  * the same way, however, they can be fully unloaded, where these
@@ -38,7 +30,9 @@ class CommandUserhost : public Command
  public:
        /** Constructor for userhost.
         */
-       CommandUserhost ( Module* parent) : Command(parent,"USERHOST",0,1) { syntax = "<nick>{,<nick>}"; }
+       CommandUserhost ( Module* parent) : Command(parent,"USERHOST", 1, 5) {
+               syntax = "<nick> {<nick>}";
+       }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
@@ -48,12 +42,9 @@ class CommandUserhost : public Command
        CmdResult Handle(const std::vector<std::string>& parameters, User *user);
 };
 
-#endif
-
-
 CmdResult CommandUserhost::Handle (const std::vector<std::string>& parameters, User *user)
 {
-       std::string retbuf = std::string("302 ") + user->nick + " :";
+       std::string retbuf = "302 " + user->nick + " :";
 
        for (unsigned int i = 0; i < parameters.size(); i++)
        {
@@ -64,13 +55,9 @@ CmdResult CommandUserhost::Handle (const std::vector<std::string>& parameters, U
                        retbuf = retbuf + u->nick;
 
                        if (IS_OPER(u))
-                       {
-                               retbuf = retbuf + "*=";
-                       }
-                       else
-                       {
-                               retbuf = retbuf + "=";
-                       }
+                               retbuf = retbuf + "*";
+
+                       retbuf = retbuf + "=";
 
                        if (IS_AWAY(u))
                                retbuf += "-";