Changeset

497:94756b0657b4

mod_ircd: added USERHOST command.
author Marco Cirillo <maranda@lightwitch.org>
date Mon, 05 Dec 2011 21:11:40 +0000
parents 496:ceeb8b3056de
children 498:2865eaf43c74
files mod_ircd/mod_ircd.in.lua
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_ircd/mod_ircd.in.lua	Mon Dec 05 05:00:28 2011 +0000
+++ b/mod_ircd/mod_ircd.in.lua	Mon Dec 05 21:11:40 2011 +0000
@@ -337,7 +337,16 @@
         end
 end
 
-function commands.USERHOST(session, params) -- Empty for now
+function commands.USERHOST(session, params) -- can show only users on the gateway. Needed for some clients to determinate self hostmask.
+	local nick = params[1];
+
+	if not nick then session.send{from=muc_server, "461", "USERHOST", "Not enough parameters"}; return; end
+
+	if nicks[nick] and nicks[nick].nick and nicks[nick].username then
+		session.send{from=muc_server, "302", session.nick, nick.."=+"..nicks[nick].username}; return;
+	else
+		return;
+	end
 end
 
 local function mode_map(am, rm, nicks)