aboutsummaryrefslogtreecommitdiffstats
path: root/src/message.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-06-24 20:25:54 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-06-24 20:25:54 +0400
commita3fa4d672341fd2f1888d3a2f2ed85ae57913b78 (patch)
tree352c634bbbc74cf17644545ace66a8feedc841c3 /src/message.c
parent63725086863e4f422340479f83dd7ef374613e76 (diff)
downloadrspamd-a3fa4d672341fd2f1888d3a2f2ed85ae57913b78.tar.gz
rspamd-a3fa4d672341fd2f1888d3a2f2ed85ae57913b78.zip
* Welcome 0.4.0
Uncompatible changes: - Statistics is uncompatible in utf8 mode Major changes: - Improved utf8 mode - Convert all characters to lowercase in statistics - Skip URL's in statistics - Improve speed of bayes classifier by using integer arithmetics - Fixed statfiles synchronization that was broken for a long time - Synchronization is now configurable Minor changes: - Bugfixes - Removed some of legacy code - Types polishing
Diffstat (limited to 'src/message.c')
-rw-r--r--src/message.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/message.c b/src/message.c
index 0586be8d7..4db4bef7d 100644
--- a/src/message.c
+++ b/src/message.c
@@ -686,25 +686,6 @@ free_byte_array_callback (void *pointer)
g_byte_array_free (arr, TRUE);
}
-static void
-detect_real_charset (struct worker_task *task, GByteArray * part_content, struct mime_text_part *text_part)
-{
- /* First of all try to detect UTF symbols */
- text_part->is_utf = FALSE;
- /* At first decision try to validate a single character */
- if (g_utf8_get_char_validated (part_content->data, part_content->len) != -1) {
- /* Now validate the whole part */
- if (g_utf8_validate (part_content->data, part_content->len, NULL)) {
- text_part->is_utf = TRUE;
- text_part->real_charset = UTF8_CHARSET;
- return;
- }
- }
-
- /* Now try to detect specific symbols from some charsets */
-
-}
-
static GByteArray *
convert_text_to_utf (struct worker_task *task, GByteArray * part_content, GMimeContentType * type, struct mime_text_part *text_part)
{
@@ -726,6 +707,7 @@ convert_text_to_utf (struct worker_task *task, GByteArray * part_content, GMimeC
if (g_ascii_strcasecmp (charset, "utf-8") == 0 || g_ascii_strcasecmp (charset, "utf8") == 0) {
text_part->is_raw = FALSE;
+ text_part->is_utf = TRUE;
return part_content;
}
@@ -741,6 +723,7 @@ convert_text_to_utf (struct worker_task *task, GByteArray * part_content, GMimeC
result_array->len = write_bytes;
memory_pool_add_destructor (task->task_pool, (pool_destruct_func) g_free, res_str);
text_part->is_raw = FALSE;
+ text_part->is_utf = TRUE;
return result_array;
}