1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
15 #include "commands/cmd_userhost.h"
17 extern "C" DllExport Command* init_command(InspIRCd* Instance)
19 return new CommandUserhost(Instance);
22 CmdResult CommandUserhost::Handle (const std::vector<std::string>& parameters, User *user)
24 std::string retbuf = std::string("302 ") + user->nick + " :";
26 for (unsigned int i = 0; i < parameters.size(); i++)
28 User *u = ServerInstance->FindNick(parameters[i]);
30 if ((u) && (u->registered == REG_ALL))
32 retbuf = retbuf + u->nick;
36 retbuf = retbuf + "*=";
40 retbuf = retbuf + "=";
48 retbuf = retbuf + u->ident + "@";
50 if (user->HasPrivPermission("users/auspex"))
52 retbuf = retbuf + u->host;
56 retbuf = retbuf + u->dhost;
59 retbuf = retbuf + " ";
63 user->WriteServ(retbuf);