mirror of
https://github.com/minetest-mods/irc.git
synced 2024-12-28 17:50:18 +01:00
Better method to avoid impersonation.
This commit is contained in:
parent
6bf4e111c2
commit
1d4fd5a162
@ -104,8 +104,9 @@ function irc.hooks.channelChat(msg)
|
|||||||
irc:check_botcmd(msg)
|
irc:check_botcmd(msg)
|
||||||
|
|
||||||
-- Don't let a user impersonate someone else by using the nick "IRC"
|
-- Don't let a user impersonate someone else by using the nick "IRC"
|
||||||
if msg.user.nick == "IRC" then
|
local fake = msg.user.nick:lower():match("^[il|]rc$")
|
||||||
irc.sendLocal("<IRC@IRC> "..text)
|
if fake then
|
||||||
|
irc.sendLocal("<"..msg.user.nick.."@IRC> "..text)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user