Better method to avoid impersonation.

This commit is contained in:
Diego Martínez 2017-03-24 22:33:43 -03:00
parent 6bf4e111c2
commit 1d4fd5a162
1 changed files with 3 additions and 2 deletions

View File

@ -104,8 +104,9 @@ function irc.hooks.channelChat(msg)
irc:check_botcmd(msg)
-- Don't let a user impersonate someone else by using the nick "IRC"
if msg.user.nick == "IRC" then
irc.sendLocal("<IRC@IRC> "..text)
local fake = msg.user.nick:lower():match("^[il|]rc$")
if fake then
irc.sendLocal("<"..msg.user.nick.."@IRC> "..text)
return
end