mu: decode mailing-list headers
MIME-decode mailing list headers, too. Also add a unit test. This fixes issue #728.
This commit is contained in:
14
lib/mu-msg.c
14
lib/mu-msg.c
@ -376,8 +376,20 @@ mu_msg_get_msgid (MuMsg *self)
|
|||||||
const char*
|
const char*
|
||||||
mu_msg_get_mailing_list (MuMsg *self)
|
mu_msg_get_mailing_list (MuMsg *self)
|
||||||
{
|
{
|
||||||
|
const char *ml;
|
||||||
|
char *decml;
|
||||||
|
|
||||||
g_return_val_if_fail (self, NULL);
|
g_return_val_if_fail (self, NULL);
|
||||||
return get_str_field (self, MU_MSG_FIELD_ID_MAILING_LIST);
|
|
||||||
|
ml = get_str_field (self, MU_MSG_FIELD_ID_MAILING_LIST);
|
||||||
|
if (!ml)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
decml = g_mime_utils_header_decode_text (ml);
|
||||||
|
if (!decml)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return free_later_str (self, decml);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -334,8 +334,9 @@ test_mu_msg_references (void)
|
|||||||
static void
|
static void
|
||||||
test_mu_msg_references_dups (void)
|
test_mu_msg_references_dups (void)
|
||||||
{
|
{
|
||||||
MuMsg *msg;
|
MuMsg *msg;
|
||||||
const GSList *refs;
|
const GSList *refs;
|
||||||
|
const char *mlist;
|
||||||
|
|
||||||
msg = get_msg (MU_TESTMAILDIR4 "/1252168370_3.14675.cthulhu!2,S");
|
msg = get_msg (MU_TESTMAILDIR4 "/1252168370_3.14675.cthulhu!2,S");
|
||||||
refs = mu_msg_get_references(msg);
|
refs = mu_msg_get_references(msg);
|
||||||
@ -363,6 +364,9 @@ test_mu_msg_references_dups (void)
|
|||||||
"20051211184308.GB13513@gauss.org");
|
"20051211184308.GB13513@gauss.org");
|
||||||
refs = g_slist_next (refs);
|
refs = g_slist_next (refs);
|
||||||
|
|
||||||
|
mlist = mu_msg_get_mailing_list (msg);
|
||||||
|
g_assert_cmpstr (mlist ,==, "Example of List Id");
|
||||||
|
|
||||||
mu_msg_unref (msg);
|
mu_msg_unref (msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,10 +409,6 @@ test_mu_msg_references_many (void)
|
|||||||
mu_msg_unref (msg);
|
mu_msg_unref (msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_mu_msg_tags (void)
|
test_mu_msg_tags (void)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -9,6 +9,7 @@ User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051010)
|
|||||||
X-Accept-Language: nl-NL, nl, en
|
X-Accept-Language: nl-NL, nl, en
|
||||||
MIME-Version: 1.0
|
MIME-Version: 1.0
|
||||||
To: dfgh@floppydisk.nl
|
To: dfgh@floppydisk.nl
|
||||||
|
List-Id: =?utf-8?q?Example_of_List_Id?=
|
||||||
Subject: Re: xyz
|
Subject: Re: xyz
|
||||||
References: <439C1136.90504@euler.org> <4399DD94.5070309@euler.org> <20051209233303.GA13812@gauss.org> <439B41ED.2080402@euler.org> <4399DD94.5070309@euler.org> <20051209233303.GA13812@gauss.org> <439A1E03.3090604@euler.org> <20051211184308.GB13513@gauss.org>
|
References: <439C1136.90504@euler.org> <4399DD94.5070309@euler.org> <20051209233303.GA13812@gauss.org> <439B41ED.2080402@euler.org> <4399DD94.5070309@euler.org> <20051209233303.GA13812@gauss.org> <439A1E03.3090604@euler.org> <20051211184308.GB13513@gauss.org>
|
||||||
In-Reply-To: <20051211184308.GB13513@gauss.org>
|
In-Reply-To: <20051211184308.GB13513@gauss.org>
|
||||||
|
|||||||
Reference in New Issue
Block a user