1
0
mirror of https://github.com/minetest-mods/irc.git synced 2024-12-26 17:00:17 +01:00

Don't allow a user with the nick "IRC" to impersonate other users

This commit is contained in:
ShadowNinja 2015-01-27 11:36:29 -05:00
parent 32294995be
commit 30fa81a3ab

View File

@ -104,6 +104,14 @@ end
function irc.hooks.channelChat(msg)
local text = normalize(msg.args[2])
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)
return
end
-- Support multiple servers in a channel better by converting:
-- "<server@IRC> <player> message" into "<player@server> message"
-- "<server@IRC> *** player joined/left the game" into "*** player joined/left server"
@ -117,8 +125,6 @@ function irc.hooks.channelChat(msg)
local foundaction, _, actionnick, actionmessage =
text:find("^%* ([^%s]+) (.*)$")
irc:check_botcmd(msg)
if text:sub(1, 5) == "[off]" then
return
elseif foundchat then