Support gmime 3.0
This commit is contained in:
@ -113,18 +113,22 @@ accumulate_text_message (MuMsg *msg, MuMsgPart *part, GString **gstrp)
|
||||
/* put sender, recipients and subject in the string, so they
|
||||
* can be indexed as well */
|
||||
mimemsg = GMIME_MESSAGE (part->data);
|
||||
str = g_mime_message_get_sender (mimemsg);
|
||||
addresses = g_mime_message_get_addresses (mimemsg, GMIME_ADDRESS_TYPE_FROM);
|
||||
adrs = internet_address_list_to_string (addresses, NULL, FALSE);
|
||||
g_string_append_printf
|
||||
(*gstrp, "%s%s", str ? str : "", str ? "\n" : "");
|
||||
(*gstrp, "%s%s", adrs ? adrs : "", adrs ? "\n" : "");
|
||||
g_free (adrs);
|
||||
|
||||
str = g_mime_message_get_subject (mimemsg);
|
||||
g_string_append_printf
|
||||
(*gstrp, "%s%s", str ? str : "", str ? "\n" : "");
|
||||
addresses = g_mime_message_get_all_recipients (mimemsg);
|
||||
adrs = internet_address_list_to_string (addresses, FALSE);
|
||||
g_object_unref (addresses);
|
||||
g_string_append_printf
|
||||
(*gstrp, "%s%s", adrs ? adrs : "", adrs ? "\n" : "");
|
||||
g_free (adrs);
|
||||
|
||||
addresses = g_mime_message_get_all_recipients (mimemsg);
|
||||
adrs = internet_address_list_to_string (addresses, NULL, FALSE);
|
||||
g_object_unref (addresses);
|
||||
g_string_append_printf
|
||||
(*gstrp, "%s%s", adrs ? adrs : "", adrs ? "\n" : "");
|
||||
g_free (adrs);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -225,7 +229,7 @@ get_part_size (GMimePart *part)
|
||||
GMimeDataWrapper *wrapper;
|
||||
GMimeStream *stream;
|
||||
|
||||
wrapper = g_mime_part_get_content_object (part);
|
||||
wrapper = g_mime_part_get_content (part);
|
||||
if (!GMIME_IS_DATA_WRAPPER(wrapper))
|
||||
return -1;
|
||||
|
||||
@ -665,7 +669,7 @@ write_part_to_fd (GMimePart *part, int fd, GError **err)
|
||||
}
|
||||
g_mime_stream_fs_set_owner (GMIME_STREAM_FS(stream), FALSE);
|
||||
|
||||
wrapper = g_mime_part_get_content_object (part);
|
||||
wrapper = g_mime_part_get_content (part);
|
||||
if (!GMIME_IS_DATA_WRAPPER(wrapper)) {
|
||||
g_set_error (err, MU_ERROR_DOMAIN, MU_ERROR_GMIME,
|
||||
"failed to create wrapper");
|
||||
@ -694,7 +698,7 @@ static gboolean
|
||||
write_object_to_fd (GMimeObject *obj, int fd, GError **err)
|
||||
{
|
||||
gchar *str;
|
||||
str = g_mime_object_to_string (obj);
|
||||
str = g_mime_object_to_string (obj, NULL);
|
||||
|
||||
if (!str) {
|
||||
g_set_error (err, MU_ERROR_DOMAIN, MU_ERROR_GMIME,
|
||||
|
||||
Reference in New Issue
Block a user