]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow to import any Lua object to message
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 28 Nov 2019 13:29:44 +0000 (13:29 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 28 Nov 2019 13:29:44 +0000 (13:29 +0000)
src/lua/lua_task.c

index cb725aadf1bb89dde1322ea91151a0850e16382c..0ea1367d53268588e0cff6d788805b699b4db8a9 100644 (file)
@@ -2111,7 +2111,7 @@ lua_task_append_message (lua_State * L)
 {
        LUA_TRACE_POINT;
        struct rspamd_task *task = lua_check_task (L, 1);
-       const gchar *message = luaL_checkstring (L, 2), *category;
+       const gchar *category;
 
        if (task != NULL) {
                if (lua_type (L, 3) == LUA_TSTRING) {
@@ -2122,7 +2122,7 @@ lua_task_append_message (lua_State * L)
                }
 
                ucl_object_insert_key (task->messages,
-                               ucl_object_fromstring_common (message, 0, UCL_STRING_RAW),
+                               ucl_object_lua_import (L, 2),
                                category, 0,
                                true);
        }