From 8691301c6629bbec380936a8e8d82471fba9a6f3 Mon Sep 17 00:00:00 2001 From: John Regan Date: Sun, 2 Apr 2017 14:15:37 -0500 Subject: [PATCH] IRC: implement USERHOST --- multistreamer/irc/server.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/multistreamer/irc/server.lua b/multistreamer/irc/server.lua index b9e9399..e8d62bf 100644 --- a/multistreamer/irc/server.lua +++ b/multistreamer/irc/server.lua @@ -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, } @@ -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