mt-mods / beerchat

beerchat mod for minetest
GNU Lesser General Public License v3.0
9 stars 7 forks source link

Send on channel refactoring #85

Closed S-S-X closed 1 year ago

S-S-X commented 1 year ago

Improves event API a bit by making few things bit more uniform.

Changed signature of few event handlers that I think have not been used much outside of beerchat mod.

Moves more stuff away from beerchat core to modular extensions which makes configuration easier.

S-S-X commented 1 year ago

I guess then rest of it can be tested in production. I've not done actual play testing but have tested / verified at least part of the logic offline.

This will cause duplication of some messages sent towards bridge but this is expected behavior and fixing it requires removing duplicate calls from other mods. For example this: https://github.com/mt-mods/beowulf/blob/f824064b0f68ed79c5a9f9b2405e7c890aa059f5/df_detect.lua#L232-L235

Should be changed to be like this (or similar but with message table):

        if has_beerchat then
-           beerchat.on_channel_message(beerchat.moderator_channel_name, "DF-Detect", msg)
            beerchat.send_on_channel("DF-Detect", beerchat.moderator_channel_name, msg)
        end