]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add `invisible` flag to url structure
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 17 Aug 2021 11:14:10 +0000 (12:14 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 17 Aug 2021 11:14:10 +0000 (12:14 +0100)
src/libserver/url.c
src/libserver/url.h
src/lua/lua_mimepart.c
src/lua/lua_task.c

index 139252df4e1618d8443ff295c91cf5dad60212a4..a56ee8b175cf17e54809e4567e7acf0d88b80069 100644 (file)
@@ -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},
 };
 
 
index 4ace18f1aa34075e1340d2b07ecab3911812a92f..8fdddaca8e2d89c42181a9d689f8d84b77462901 100644 (file)
@@ -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)
 
index 66b588e3aa81cfa7324744d411f15e67cb1c7e34..f403313a157758611beb2ac20183d0ab372efa08 100644 (file)
@@ -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");
        }
 
index eacf1bd1552d4f9f24ffba0ab042cb660d271b01..42dbbae25856f846f0e029ea7e1369bf6326894a 100644 (file)
@@ -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");
                        }