diff options
author | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2020-03-29 19:06:47 +0200 |
---|---|---|
committer | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2020-03-29 19:06:47 +0200 |
commit | 9d068d383713406ee078e746b4e4a0149e18ebf2 (patch) | |
tree | 3b07e6bfe9b18528c69124617072e09c8a952583 | |
parent | 5892c472fd95ba6d36e9ddc6917486d6dbdb33b9 (diff) | |
download | beerchat-9d068d383713406ee078e746b4e4a0149e18ebf2.tar.gz beerchat-9d068d383713406ee078e746b4e4a0149e18ebf2.tar.bz2 beerchat-9d068d383713406ee078e746b4e4a0149e18ebf2.zip |
Show channel name except on main channel
-rw-r--r-- | init.lua | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -694,7 +694,11 @@ minetest.register_on_chat_message(function(name, message) -- Checking if the target is in this channel if playersChannels[target][channel_name] then if not minetest.get_player_by_name(target):get_attribute("beerchat:muted:"..name) then - minetest.chat_send_player(target, format_message(main_channel_message_string, { channel_name = channel_name, from_player = name, message = message })) + if channel_name == main_channel_name then + minetest.chat_send_player(target, format_message(main_channel_message_string, { channel_name = channel_name, from_player = name, message = message })) + else + minetest.chat_send_player(target, format_message(channel_message_string, { channel_name = channel_name, from_player = name, message = message })) + end if channel_name ~= main_channel_name and enable_sounds then minetest.sound_play(channel_message_sound, { to_player = target, gain = 1.0 } ) end |