diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-09-09 11:03:23 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-09-09 11:03:23 +0100 |
commit | c7dc4430fdfe25d4f86b0aa8c9bf6ca0c7a49c23 (patch) | |
tree | 6a9a00b5cbadd1bd94f540c00013bceb7641e4a5 /src/lua | |
parent | 76b863e79e39ec5e1c99cee6e4263abe02f6f8d0 (diff) | |
download | rspamd-c7dc4430fdfe25d4f86b0aa8c9bf6ca0c7a49c23.tar.gz rspamd-c7dc4430fdfe25d4f86b0aa8c9bf6ca0c7a49c23.zip |
[Minor] Lua_task: Return number of recipients in has_recipients method
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_task.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index ba4393200..576c7e1cc 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -3438,6 +3438,7 @@ lua_task_set_recipients (lua_State *L) } \ else { \ ret = addr->len > 0; \ + nrcpt = addr->len; \ } \ } while (0) @@ -3446,7 +3447,7 @@ lua_task_has_from (lua_State *L) { LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); - gint what = 0; + gint what = 0, nrcpt = 0; gboolean ret = FALSE; if (task) { @@ -3488,7 +3489,7 @@ lua_task_has_recipients (lua_State *L) { LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); - gint what = 0; + gint what = 0, nrcpt = 0; gboolean ret = FALSE; if (task) { @@ -3522,6 +3523,11 @@ lua_task_has_recipients (lua_State *L) lua_pushboolean (L, ret); + if (ret) { + lua_pushinteger (L, nrcpt); + return 2; + } + return 1; } |