aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-23 16:00:53 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-23 16:00:53 +0100
commit8bf359e9f41aff57695967c6ae8ac623e5ac941e (patch)
treec3b86624d6f9c59006173f39c157008cb86b8bf0
parent096077151126a465bd60cc43ad4095ff010891c4 (diff)
downloadrspamd-8bf359e9f41aff57695967c6ae8ac623e5ac941e.tar.gz
rspamd-8bf359e9f41aff57695967c6ae8ac623e5ac941e.zip
[Minor] Show transparency and tag name in HTML blocks
-rw-r--r--src/lua/lua_html.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lua/lua_html.c b/src/lua/lua_html.c
index 8d75bfa67..3734e37ff 100644
--- a/src/lua/lua_html.c
+++ b/src/lua/lua_html.c
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include <src/libserver/html.h>
#include "lua_common.h"
#include "message.h"
#include "html.h"
@@ -317,38 +318,39 @@ static void
lua_html_push_block (lua_State *L, struct html_block *bl)
{
struct rspamd_lua_text *t;
- struct html_tag **ptag;
lua_createtable (L, 0, 6);
if (bl->tag) {
lua_pushstring (L, "tag");
- ptag = lua_newuserdata (L, sizeof (gpointer));
- *ptag = bl->tag;
- rspamd_lua_setclass (L, "rspamd{html_tag}", -1);
+ lua_pushlstring (L, bl->tag->name.start, bl->tag->name.len);
lua_settable (L, -3);
}
if (bl->font_color.valid) {
lua_pushstring (L, "color");
- lua_newtable (L);
+ lua_createtable (L, 4, 0);
lua_pushnumber (L, bl->font_color.d.comp.r);
lua_rawseti (L, -2, 1);
lua_pushnumber (L, bl->font_color.d.comp.g);
lua_rawseti (L, -2, 2);
lua_pushnumber (L, bl->font_color.d.comp.b);
lua_rawseti (L, -2, 3);
+ lua_pushnumber (L, bl->font_color.d.comp.alpha);
+ lua_rawseti (L, -2, 4);
lua_settable (L, -3);
}
if (bl->background_color.valid) {
lua_pushstring (L, "bgcolor");
- lua_newtable (L);
+ lua_createtable (L, 4, 0);
lua_pushnumber (L, bl->background_color.d.comp.r);
lua_rawseti (L, -2, 1);
lua_pushnumber (L, bl->background_color.d.comp.g);
lua_rawseti (L, -2, 2);
lua_pushnumber (L, bl->background_color.d.comp.b);
lua_rawseti (L, -2, 3);
+ lua_pushnumber (L, bl->background_color.d.comp.alpha);
+ lua_rawseti (L, -2, 4);
lua_settable (L, -3);
}