commit eb60784: [Minor] Add `invisible` flag to url structure
Vsevolod Stakhov
vsevolod at highsecure.ru
Tue Aug 17 11:21:04 UTC 2021
Author: Vsevolod Stakhov
Date: 2021-08-17 12:14:10 +0100
URL: https://github.com/rspamd/rspamd/commit/eb60784ac2d3514bba1af00750f40ce1ff74389a
[Minor] Add `invisible` flag to url structure
---
src/libserver/url.c | 1 +
src/libserver/url.h | 2 ++
src/lua/lua_mimepart.c | 2 +-
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");
}
More information about the Commits
mailing list