* mu-msg-file: set the MU_FLAG_LIST flag, if the message looks like an ML-message
This commit is contained in:
@ -36,7 +36,6 @@ static gboolean init_file_metadata (MuMsgFile *self, const char* path,
|
|||||||
const char *mdir, GError **err);
|
const char *mdir, GError **err);
|
||||||
static gboolean init_mime_msg (MuMsgFile *msg, const char *path, GError **err);
|
static gboolean init_mime_msg (MuMsgFile *msg, const char *path, GError **err);
|
||||||
|
|
||||||
|
|
||||||
MuMsgFile*
|
MuMsgFile*
|
||||||
mu_msg_file_new (const char* filepath, const char *mdir, GError **err)
|
mu_msg_file_new (const char* filepath, const char *mdir, GError **err)
|
||||||
{
|
{
|
||||||
@ -205,7 +204,7 @@ get_recipient (MuMsgFile *self, GMimeRecipientType rtype)
|
|||||||
* headers in the mail
|
* headers in the mail
|
||||||
*/
|
*/
|
||||||
static gchar*
|
static gchar*
|
||||||
get_fake_mailing_list (MuMsgFile *self)
|
get_fake_mailing_list_maybe (MuMsgFile *self)
|
||||||
{
|
{
|
||||||
const char* hdr;
|
const char* hdr;
|
||||||
|
|
||||||
@ -235,7 +234,7 @@ get_mailing_list (MuMsgFile *self)
|
|||||||
hdr = g_mime_object_get_header (GMIME_OBJECT(self->_mime_msg),
|
hdr = g_mime_object_get_header (GMIME_OBJECT(self->_mime_msg),
|
||||||
"List-Id");
|
"List-Id");
|
||||||
if (mu_str_is_empty (hdr))
|
if (mu_str_is_empty (hdr))
|
||||||
return get_fake_mailing_list (self);
|
return get_fake_mailing_list_maybe (self);
|
||||||
|
|
||||||
e = NULL;
|
e = NULL;
|
||||||
b = strchr (hdr, '<');
|
b = strchr (hdr, '<');
|
||||||
@ -312,6 +311,7 @@ static MuFlags
|
|||||||
get_content_flags (MuMsgFile *self)
|
get_content_flags (MuMsgFile *self)
|
||||||
{
|
{
|
||||||
MuFlags flags;
|
MuFlags flags;
|
||||||
|
char *ml;
|
||||||
|
|
||||||
flags = MU_FLAG_NONE;
|
flags = MU_FLAG_NONE;
|
||||||
|
|
||||||
@ -320,6 +320,14 @@ get_content_flags (MuMsgFile *self)
|
|||||||
FALSE, /* never decrypt for this */
|
FALSE, /* never decrypt for this */
|
||||||
(GMimeObjectForeachFunc)msg_cflags_cb,
|
(GMimeObjectForeachFunc)msg_cflags_cb,
|
||||||
&flags);
|
&flags);
|
||||||
|
|
||||||
|
ml = get_mailing_list (self);
|
||||||
|
if (ml) {
|
||||||
|
flags |= MU_FLAG_LIST;
|
||||||
|
g_free (ml);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user