commit 1432a7a: [Minor] Improve documentation

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Feb 20 21:49:06 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-02-20 21:20:29 +0000
URL: https://github.com/rspamd/rspamd/commit/1432a7af36901e9cb5243b5d83a377656728896e

[Minor] Improve documentation

---
 src/lua/lua_task.c                | 10 +++++++---
 src/plugins/lua/force_actions.lua |  1 +
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 7e14b05de..1412a0035 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -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
  */
diff --git a/src/plugins/lua/force_actions.lua b/src/plugins/lua/force_actions.lua
index c2a48e148..108c0b76e 100644
--- a/src/plugins/lua/force_actions.lua
+++ b/src/plugins/lua/force_actions.lua
@@ -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


More information about the Commits mailing list