Mercurial > prosody-modules
comparison mod_ircd/mod_ircd.in.lua @ 497:94756b0657b4
mod_ircd: added USERHOST command.
author | Marco Cirillo <maranda@lightwitch.org> |
---|---|
date | Mon, 05 Dec 2011 21:11:40 +0000 |
parents | ceeb8b3056de |
children | 2865eaf43c74 |
comparison
equal
deleted
inserted
replaced
496:ceeb8b3056de | 497:94756b0657b4 |
---|---|
335 if session.username and session.nick then -- send MOTD | 335 if session.username and session.nick then -- send MOTD |
336 send_motd(session); | 336 send_motd(session); |
337 end | 337 end |
338 end | 338 end |
339 | 339 |
340 function commands.USERHOST(session, params) -- Empty for now | 340 function commands.USERHOST(session, params) -- can show only users on the gateway. Needed for some clients to determinate self hostmask. |
341 local nick = params[1]; | |
342 | |
343 if not nick then session.send{from=muc_server, "461", "USERHOST", "Not enough parameters"}; return; end | |
344 | |
345 if nicks[nick] and nicks[nick].nick and nicks[nick].username then | |
346 session.send{from=muc_server, "302", session.nick, nick.."=+"..nicks[nick].username}; return; | |
347 else | |
348 return; | |
349 end | |
341 end | 350 end |
342 | 351 |
343 local function mode_map(am, rm, nicks) | 352 local function mode_map(am, rm, nicks) |
344 local rnick; | 353 local rnick; |
345 local c_modes; | 354 local c_modes; |