aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_html.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-10-09 12:07:28 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-10-09 12:07:46 +0100
commitf1a4121eca2230cfe364808a92e3b4d909a183b4 (patch)
treeb62761250815f2b5a6da588911327031d98d1445 /src/lua/lua_html.c
parent47e260127847f720b64535205251ea39f86ab514 (diff)
downloadrspamd-f1a4121eca2230cfe364808a92e3b4d909a183b4.tar.gz
rspamd-f1a4121eca2230cfe364808a92e3b4d909a183b4.zip
[Feature] Store url object in images
Diffstat (limited to 'src/lua/lua_html.c')
-rw-r--r--src/lua/lua_html.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lua/lua_html.c b/src/lua/lua_html.c
index 95072fe6c..47b8c7dfd 100644
--- a/src/lua/lua_html.c
+++ b/src/lua/lua_html.c
@@ -260,6 +260,7 @@ lua_html_push_image (lua_State *L, struct html_image *img)
{
LUA_TRACE_POINT;
struct html_tag **ptag;
+ struct rspamd_url **purl;
lua_newtable (L);
@@ -269,6 +270,14 @@ lua_html_push_image (lua_State *L, struct html_image *img)
lua_settable (L, -3);
}
+ if (img->url) {
+ lua_pushstring (L, "url");
+ purl = lua_newuserdata (L, sizeof (gpointer));
+ *purl = img->url;
+ rspamd_lua_setclass (L, "rspamd{url}", -1);
+ lua_settable (L, -3);
+ }
+
if (img->tag) {
lua_pushstring (L, "tag");
ptag = lua_newuserdata (L, sizeof (gpointer));