]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Improve documentation
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 20 Feb 2020 21:20:29 +0000 (21:20 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 20 Feb 2020 21:20:29 +0000 (21:20 +0000)
src/lua/lua_task.c
src/plugins/lua/force_actions.lua

index 7e14b05debf4f7bceb46ab397bb79a869ce15554..1412a0035f20212bf41e2fc2f4c4f7448215bdfc 100644 (file)
@@ -158,7 +158,7 @@ LUA_FUNCTION_DEF (task, insert_result);
  */
 LUA_FUNCTION_DEF (task, adjust_result);
 /***
- * @method task:set_pre_result(action, description)
+ * @method task:set_pre_result(action, [message, [module], [score], [priority], [flags])
  * Sets pre-result for a task. It is used in pre-filters to specify early result
  * of the task scanned. If a pre-filter sets some result, then further processing
  * may be skipped. For selecting action it is possible to use global table
@@ -170,12 +170,16 @@ LUA_FUNCTION_DEF (task, adjust_result);
  * - `greylist`: greylist message
  * - `accept` or `no action`: whitelist message
  * @param {rspamd_action or string} action a numeric or string action value
- * @param {string} description optional description
+ * @param {string} message action message
+ * @param {string} module optional module name
+ * @param {number/nil} score optional explicit score
+ * @param {number/nil} priority optional explicit priority
+ * @param {string/nil} flags optional flags (e.g. 'least' for least action)
 @example
 local function cb(task)
        local gr = task:get_header('Greylist')
        if gr and gr == 'greylist' then
-               task:set_pre_result(rspamd_actions['greylist'], 'Greylisting required')
+               task:set_pre_result('soft reject', 'Greylisting required')
        end
 end
  */
index c2a48e148c12bc74e17ad9c3367d14f014fca10e..108c0b76ea522eab83ffd9a8a34b3be0828484b4 100644 (file)
@@ -84,6 +84,7 @@ local function gen_cb(expr, act, pool, message, subject, raction, honor, limit,
 
       if type(message) == 'string' then
         task:set_pre_result(act, message, N, nil, nil, flags)
+
       else
         task:set_pre_result(act, nil, N, nil, nil, flags)
       end