aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-14 18:26:46 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-14 18:26:46 +0100
commit57d61529038fe4c1a27e20871b13788409388c25 (patch)
tree926162d18cffe4f3bff4212a34e4283f91c82f18
parentd16186f149e92f702e2e02de3ce76f4aa22ce28f (diff)
downloadrspamd-57d61529038fe4c1a27e20871b13788409388c25.tar.gz
rspamd-57d61529038fe4c1a27e20871b13788409388c25.zip
Pass group name to lua in task:get_symbol method.
-rw-r--r--src/lua/lua_task.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 4d9f44cee..90bf39e1b 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -354,6 +354,7 @@ LUA_FUNCTION_DEF (task, get_images);
* - `metric` - name of metric
* - `score` - score of a symbol in that metric
* - `options` - a table of strings representing options of a symbol
+ * - `group` - a group of symbol (or 'ungrouped')
* @param {string} name symbol's name
* @return {list of tables} list of tables or nil if symbol was not found in any metric
*/
@@ -1528,6 +1529,18 @@ lua_push_symbol_result (lua_State *L,
lua_pushstring (L, "score");
lua_pushnumber (L, s->score);
lua_settable (L, -3);
+
+ if (s->def) {
+ lua_pushstring (L, "group");
+ lua_pushstring (L, s->def->gr->name);
+ lua_settable (L, -3);
+ }
+ else {
+ lua_pushstring (L, "group");
+ lua_pushstring (L, "ungrouped");
+ lua_settable (L, -3);
+ }
+
if (s->options) {
opt = s->options;
lua_pushstring (L, "options");