From: Vsevolod Stakhov Date: Thu, 23 Apr 2020 15:10:48 +0000 (+0100) Subject: [Minor] Lua_selectors: Add optional shadow result name X-Git-Tag: 2.6~495 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e6556d52c29bc350b20bea5480726eb98c460639;p=rspamd.git [Minor] Lua_selectors: Add optional shadow result name --- diff --git a/lualib/lua_selectors/extractors.lua b/lualib/lua_selectors/extractors.lua index c01a07f4b..c40b93b3b 100644 --- a/lualib/lua_selectors/extractors.lua +++ b/lualib/lua_selectors/extractors.lua @@ -418,16 +418,18 @@ The first argument must be header name.]], -- Get specific symbol ['symbol'] = { ['get_value'] = function(task, args) - local symbol = task:get_symbol(args[1]) + local symbol = task:get_symbol(args[1], args[2]) if symbol then return symbol[1],'table' end end, ['description'] = 'Get specific symbol. The first argument must be the symbol name. ' .. + 'The second argument is an optional shadow result name. ' .. 'Returns the symbol table. See task:get_symbol()', - ['args_schema'] = {ts.string} + ['args_schema'] = {ts.string, ts.string:is_optional()} }, + } return extractors