* updates for mu_msg_get_body_(text|html) api change
This commit is contained in:
@ -62,7 +62,8 @@ _MuStore::get_uid_term (const char* path)
|
||||
* messages are only considered ones (ignore e.g. symlinks and
|
||||
* '//' in paths) */
|
||||
if (!realpath (path, real_path)) {
|
||||
g_warning ("realpath() failed: %s", strerror (errno));
|
||||
g_warning ("realpath() failed for %s: %s",
|
||||
path, strerror (errno));
|
||||
strcpy (real_path, path); /* ignore errors */
|
||||
}
|
||||
|
||||
|
||||
@ -390,14 +390,13 @@ maybe_index_text_part (MuMsg *msg, MuMsgPart *part, PartData *pdata)
|
||||
char *txt, *norm;
|
||||
Xapian::TermGenerator termgen;
|
||||
|
||||
/* we handle the body text elsewhere; this is about other text
|
||||
/* only deal with attachments, inlines are indexed as body
|
||||
* parts */
|
||||
if (part->part_type & MU_MSG_PART_TYPE_BODY)
|
||||
if (!(part->part_type & MU_MSG_PART_TYPE_ATTACHMENT))
|
||||
return;
|
||||
|
||||
/* TODO: add other text types? */
|
||||
if (g_ascii_strcasecmp (part->type, "text") != 0 ||
|
||||
g_ascii_strcasecmp (part->subtype, "plain") != 0)
|
||||
/* only text/plain */
|
||||
if (!(part->part_type & MU_MSG_PART_TYPE_TEXT_PLAIN))
|
||||
return;
|
||||
|
||||
txt = mu_msg_part_get_text (msg, part, MU_MSG_OPTION_NONE,
|
||||
@ -475,10 +474,10 @@ add_terms_values_body (Xapian::Document& doc, MuMsg *msg,
|
||||
if (mu_msg_get_flags(msg) & MU_FLAG_ENCRYPTED)
|
||||
return; /* ignore encrypted bodies */
|
||||
|
||||
str = mu_msg_get_body_text (msg);
|
||||
str = mu_msg_get_body_text (msg, MU_MSG_OPTION_NONE);
|
||||
if (!str) /* FIXME: html->txt fallback needed */
|
||||
str = mu_msg_get_body_html (msg);
|
||||
|
||||
str = mu_msg_get_body_html (msg,
|
||||
MU_MSG_OPTION_NONE);
|
||||
if (!str)
|
||||
return; /* no body... */
|
||||
|
||||
|
||||
@ -181,7 +181,7 @@ test_mu_msg_03 (void)
|
||||
==, MU_MSG_PRIO_NORMAL);
|
||||
g_assert_cmpuint (mu_msg_get_date(msg),
|
||||
==, 0);
|
||||
g_assert_cmpstr (mu_msg_get_body_text(msg),
|
||||
g_assert_cmpstr (mu_msg_get_body_text(msg, MU_MSG_OPTION_NONE),
|
||||
==,
|
||||
"\nLet's write some fünkÿ text\nusing umlauts.\n\nFoo.\n");
|
||||
g_assert_cmpuint (mu_msg_get_flags(msg),
|
||||
@ -224,7 +224,7 @@ test_mu_msg_multimime (void)
|
||||
/* ie., are text parts properly concatenated? */
|
||||
g_assert_cmpstr (mu_msg_get_subject(msg),
|
||||
==, "multimime");
|
||||
g_assert_cmpstr (mu_msg_get_body_text(msg),
|
||||
g_assert_cmpstr (mu_msg_get_body_text(msg, MU_MSG_OPTION_NONE),
|
||||
==, "abcdef");
|
||||
g_assert_cmpuint (mu_msg_get_flags(msg),
|
||||
==, MU_FLAG_FLAGGED | MU_FLAG_SEEN |
|
||||
|
||||
Reference in New Issue
Block a user