]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/cmd_userhost.cpp
Set EOL to WINDOWS-style always for Visual Studio files.
[user/henk/code/inspircd.git] / src / cmd_userhost.cpp
1 /*       +------------------------------------+\r *       | Inspire Internet Relay Chat Daemon |\r *       +------------------------------------+\r *\r *  InspIRCd: (C) 2002-2007 InspIRCd Development Team\r * See: http://www.inspircd.org/wiki/index.php/Credits\r *\r * This program is free but copyrighted software; see\r *            the file COPYING for details.\r *\r * ---------------------------------------------------\r */\r\r#include "inspircd.h"\r#include "users.h"\r#include "commands/cmd_userhost.h"\r\rextern "C" DllExport command_t* init_command(InspIRCd* Instance)\r{\r    return new cmd_userhost(Instance);\r}\r\rCmdResult cmd_userhost::Handle (const char** parameters, int pcnt, userrec *user)\r{\r      std::string retbuf = std::string("302 ") + user->nick + " :";\r\r \r       for (int i = 0; i < pcnt; i++)\r {\r              userrec *u = ServerInstance->FindNick(parameters[i]);\r\r         if ((u) && (u->registered == REG_ALL))\r         {\r                      retbuf = retbuf + u->nick;\r\r                    if (IS_OPER(u))\r                        {\r                              retbuf = retbuf + "*=+";\r                       }\r                      else\r                   {\r                              retbuf = retbuf + "=+";\r                        }\r\r                     retbuf = retbuf + u->ident + "@";\r\r                     if (IS_OPER(user))\r                     {\r                              retbuf = retbuf + u->host;\r                     }\r                      else\r                   {\r                              retbuf = retbuf + u->dhost;\r                    }\r\r                     retbuf = retbuf + " ";\r         }\r      }\r\r     user->WriteServ(retbuf);\r\r      return CMD_SUCCESS;\r}\r