Skip to content

Commit

Permalink
[Minor] Lemove legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Jul 4, 2021
1 parent bdd0df7 commit 0e21fac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 27 deletions.
1 change: 0 additions & 1 deletion src/libmime/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,6 @@ rspamd_message_process_html_text_part (struct rspamd_task *task,
}


text_part->flags |= RSPAMD_MIME_TEXT_PART_FLAG_BALANCED;
text_part->html = rspamd_html_process_part_full (
task->task_pool,
text_part->utf_raw_content,
Expand Down
13 changes: 5 additions & 8 deletions src/libmime/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,11 @@ struct rspamd_mime_part {
};

#define RSPAMD_MIME_TEXT_PART_FLAG_UTF (1 << 0)
#define RSPAMD_MIME_TEXT_PART_FLAG_BALANCED (1 << 1)
#define RSPAMD_MIME_TEXT_PART_FLAG_EMPTY (1 << 2)
#define RSPAMD_MIME_TEXT_PART_FLAG_HTML (1 << 3)
#define RSPAMD_MIME_TEXT_PART_FLAG_8BIT_RAW (1 << 4)
#define RSPAMD_MIME_TEXT_PART_FLAG_8BIT_ENCODED (1 << 5)
#define RSPAMD_MIME_TEXT_PART_HAS_SUBNORMAL (1 << 6)
#define RSPAMD_MIME_TEXT_PART_NORMALISED (1 << 7)
#define RSPAMD_MIME_TEXT_PART_ATTACHMENT (1 << 8)
#define RSPAMD_MIME_TEXT_PART_FLAG_EMPTY (1 << 1)
#define RSPAMD_MIME_TEXT_PART_FLAG_HTML (1 << 2)
#define RSPAMD_MIME_TEXT_PART_FLAG_8BIT_RAW (1 << 3)
#define RSPAMD_MIME_TEXT_PART_FLAG_8BIT_ENCODED (1 << 4)
#define RSPAMD_MIME_TEXT_PART_ATTACHMENT (1 << 5)

#define IS_TEXT_PART_EMPTY(part) ((part)->flags & RSPAMD_MIME_TEXT_PART_FLAG_EMPTY)
#define IS_TEXT_PART_UTF(part) ((part)->flags & RSPAMD_MIME_TEXT_PART_FLAG_UTF)
Expand Down
20 changes: 2 additions & 18 deletions src/libmime/mime_expressions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1564,24 +1564,8 @@ rspamd_compare_transfer_encoding (struct rspamd_task * task,
gboolean
rspamd_is_html_balanced (struct rspamd_task * task, GArray * args, void *unused)
{
struct rspamd_mime_text_part *p;
guint i;
gboolean res = TRUE;

PTR_ARRAY_FOREACH (MESSAGE_FIELD (task, text_parts), i, p) {
if (IS_TEXT_PART_HTML (p)) {
if (p->flags & RSPAMD_MIME_TEXT_PART_FLAG_BALANCED) {
res = TRUE;
}
else {
res = FALSE;
break;
}
}
}

return res;

/* Totally broken but seems to be never used */
return TRUE;
}

gboolean
Expand Down

0 comments on commit 0e21fac

Please sign in to comment.