From 8dadd8043ce22a53e161ab379998d7bf3a509036 Mon Sep 17 00:00:00 2001 From: Athozus Date: Sun, 18 Jun 2023 15:29:27 +0200 Subject: [PATCH] Permit start composition of a message by passing receivers into /mail command (close #101) --- chatcommands.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/chatcommands.lua b/chatcommands.lua index c77ba33..a152274 100644 --- a/chatcommands.lua +++ b/chatcommands.lua @@ -1,6 +1,10 @@ minetest.register_chatcommand("mail",{ description = "Open the mail interface", - func = function(name) - mail.show_mail_menu(name) + func = function(name, param) + if #param > 0 then -- if param is not empty + mail.show_compose(name, param) -- make a new message + else + mail.show_mail_menu(name) -- show main menu + end end })