Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
IRC: implement USERHOST
Browse files Browse the repository at this point in the history
  • Loading branch information
jprjr committed Apr 2, 2017
1 parent adc2c89 commit 8691301
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions multistreamer/irc/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ function IRCServer.new(socket,user,parentServer)
['TOPIC'] = IRCServer.clientTopic,
['USERHOST'] = IRCServer.clientUnknown,
['USERS'] = IRCServer.clientUsers,
['USERHOST'] = IRCServer.clientUserhost,
['WHO'] = IRCServer.clientWho,
['WHOIS'] = IRCServer.clientWhois,
}
Expand Down Expand Up @@ -664,6 +665,20 @@ function IRCServer:clientIson(nick,msg)
return self:sendClientFromServer(nick,'303',resp)
end

function IRCServer:clientUserhost(nick,msg)
local resp = ':'
local i = 1
for _,u in pairs(msg.args) do
if self.users[u] then
if i > 1 then
u = ' ' .. u
end
resp = resp .. u .. '=' .. u .. '@' .. config.irc_hostname
end
end
return self:sendClientFromServer(nick,'302', resp)
end

function IRCServer:clientWhois(nick,msg)
local nicks = msg.args[1]:split(',')
for _,n in ipairs(nicks) do
Expand Down

0 comments on commit 8691301

Please sign in to comment.