Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IRC should override minetest.send_join/leave_message #72

Open
magnetar47 opened this issue Aug 13, 2022 · 0 comments
Open

IRC should override minetest.send_join/leave_message #72

magnetar47 opened this issue Aug 13, 2022 · 0 comments

Comments

@magnetar47
Copy link

Hello. We have a mod in CTF that over-rides minetest.send_join/leave_message to hide the join and leave messages of a certain group of players. While that works for in-game messages, IRC bypasses the aforementioned functions and directly outputs the message to the channel (if set to send join/leave messages). So mods don't have the opportunity to suppress join/leave messages for select players, and other such use-cases.

I was wondering if IRC could instead override minetest.send_join/leave_message like so:

local old_join_func = minetest.send_join_message
function minetest.send_join_message(player_name, ...)
	// Announce player join on IRC channel
	irc.say("*** "..name.." joined the game")

	return old_join_func(player_name, ...)
end

So then I can do:

local old_join_func - minetest.send_join_message
function minetest.send_join_message(pname, ...)
	-- Skip join message if player matches super special criteria
	if not super_special_criteria(pname) then
		return old_join_func(pname, ...)
	end
end

Thoughts and discussion welcome. I'd be willing to implement this if people think this is a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant