diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-08-17 12:14:10 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-08-17 12:14:10 +0100 |
commit | eb60784ac2d3514bba1af00750f40ce1ff74389a (patch) | |
tree | cdc29befbbd8b540672d93898dbf8b67acfc8be0 | |
parent | e3a05b7969106514ce2e8c46e419e023f4a28d4d (diff) | |
download | rspamd-eb60784ac2d3514bba1af00750f40ce1ff74389a.tar.gz rspamd-eb60784ac2d3514bba1af00750f40ce1ff74389a.zip |
[Minor] Add `invisible` flag to url structure
-rw-r--r-- | src/libserver/url.c | 1 | ||||
-rw-r--r-- | src/libserver/url.h | 2 | ||||
-rw-r--r-- | src/lua/lua_mimepart.c | 2 | ||||
-rw-r--r-- | src/lua/lua_task.c | 6 |
4 files changed, 8 insertions, 3 deletions
diff --git a/src/libserver/url.c b/src/libserver/url.c index 139252df4..a56ee8b17 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -244,6 +244,7 @@ struct rspamd_url_flag_name { {"no_tld", RSPAMD_URL_FLAG_NO_TLD, -1}, {"truncated", RSPAMD_URL_FLAG_TRUNCATED, -1}, {"redirect_target", RSPAMD_URL_FLAG_REDIRECT_TARGET, -1}, + {"invisible", RSPAMD_URL_FLAG_INVISIBLE, -1}, }; diff --git a/src/libserver/url.h b/src/libserver/url.h index 4ace18f1a..8fdddaca8 100644 --- a/src/libserver/url.h +++ b/src/libserver/url.h @@ -41,6 +41,8 @@ enum rspamd_url_flags { RSPAMD_URL_FLAG_NO_TLD = 1u << 22u, RSPAMD_URL_FLAG_TRUNCATED = 1u << 23u, RSPAMD_URL_FLAG_REDIRECT_TARGET = 1u << 24u, + RSPAMD_URL_FLAG_INVISIBLE = 1u << 25u, + }; #define RSPAMD_URL_MAX_FLAG_SHIFT (25u) diff --git a/src/lua/lua_mimepart.c b/src/lua/lua_mimepart.c index 66b588e3a..f403313a1 100644 --- a/src/lua/lua_mimepart.c +++ b/src/lua/lua_mimepart.c @@ -2116,7 +2116,7 @@ lua_mimepart_get_urls (lua_State * L) } if (!lua_url_cbdata_fill (L, 2, &cb, default_protocols_mask, - ~(0), max_urls)) { + ~(RSPAMD_URL_FLAG_INVISIBLE), max_urls)) { return luaL_error (L, "invalid arguments"); } diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index eacf1bd15..42dbbae25 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -2462,7 +2462,8 @@ lua_task_get_urls (lua_State * L) /* Exclude RSPAMD_URL_FLAG_CONTENT to preserve backward compatibility */ if (!lua_url_cbdata_fill (L, 2, &cb, default_protocols_mask, - ~(RSPAMD_URL_FLAG_CONTENT|RSPAMD_URL_FLAG_IMAGE), max_urls)) { + ~(RSPAMD_URL_FLAG_CONTENT|RSPAMD_URL_FLAG_IMAGE|RSPAMD_URL_FLAG_INVISIBLE), + max_urls)) { return luaL_error (L, "invalid arguments"); } @@ -2734,7 +2735,8 @@ lua_task_get_emails (lua_State * L) } if (!lua_url_cbdata_fill (L, 2, &cb, PROTOCOL_MAILTO, - ~(RSPAMD_URL_FLAG_CONTENT|RSPAMD_URL_FLAG_IMAGE), max_urls)) { + ~(RSPAMD_URL_FLAG_CONTENT|RSPAMD_URL_FLAG_IMAGE|RSPAMD_URL_FLAG_INVISIBLE), + max_urls)) { return luaL_error (L, "invalid arguments"); } |