]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Lua_selectors: Add optional shadow result name
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 23 Apr 2020 15:10:48 +0000 (16:10 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 23 Apr 2020 15:10:48 +0000 (16:10 +0100)
lualib/lua_selectors/extractors.lua

index c01a07f4b3b8c1ea838b0641fb1d769c09288f34..c40b93b3b6a4d7fca50c774fb6def074b500f61e 100644 (file)
@@ -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