-/* +------------------------------------+\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
\ No newline at end of file
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#include "inspircd.h"
+#include "commands/cmd_userhost.h"
+
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
+{
+ return new cmd_userhost(Instance);
+}
+
+CmdResult cmd_userhost::Handle (const char** parameters, int pcnt, userrec *user)
+{
+ std::string retbuf = std::string("302 ") + user->nick + " :";
+
+
+ for (int i = 0; i < pcnt; i++)
+ {
+ userrec *u = ServerInstance->FindNick(parameters[i]);
+
+ if ((u) && (u->registered == REG_ALL))
+ {
+ retbuf = retbuf + u->nick;
+
+ if (IS_OPER(u))
+ {
+ retbuf = retbuf + "*=+";
+ }
+ else
+ {
+ retbuf = retbuf + "=+";
+ }
+
+ retbuf = retbuf + u->ident + "@";
+
+ if (IS_OPER(user))
+ {
+ retbuf = retbuf + u->host;
+ }
+ else
+ {
+ retbuf = retbuf + u->dhost;
+ }
+
+ retbuf = retbuf + " ";
+ }
+ }
+
+ user->WriteServ(retbuf);
+
+ return CMD_SUCCESS;
+}