From: Vsevolod Stakhov Date: Tue, 14 Apr 2015 17:26:46 +0000 (+0100) Subject: Pass group name to lua in task:get_symbol method. X-Git-Tag: 0.9.0~246 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=57d61529038fe4c1a27e20871b13788409388c25;p=thirdparty%2Frspamd.git Pass group name to lua in task:get_symbol method. --- diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 4d9f44ceec..90bf39e1b0 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");