From 1a033ecbcad75fa2d52878a7000f39880ac36771 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Thu, 5 Oct 2017 23:48:46 +0100 Subject: [PATCH] Add chatplus.send_message_to_sender() --- mods/chatplus/api.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mods/chatplus/api.lua b/mods/chatplus/api.lua index 7196f23..8ce34f9 100644 --- a/mods/chatplus/api.lua +++ b/mods/chatplus/api.lua @@ -189,7 +189,7 @@ function chatplus.send(from, msg) if msg:sub(1, 1) == "/" then return false end - + if not minetest.check_player_privs(from, {shout = true}) then return nil end @@ -220,12 +220,16 @@ function chatplus.send(from, msg) minetest.chat_send_player(to, "<" .. from .. "> " .. msg) end elseif minetest.features.no_chat_message_prediction then - minetest.chat_send_player(from, "<" .. from .. "> " .. msg) + chatplus.send_message_to_sender(from, msg) end end return true end +function chatplus.send_message_to_sender(from, msg) + minetest.chat_send_player(from, "<" .. from .. "> " .. msg) +end + -- Minetest callbacks minetest.register_on_chat_message(function(...)