mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
lib: wrap use of g_mime_utils_header_decode_date
This changes return type in gmime 3.0
This commit is contained in:
parent
fd6e4a9953
commit
c040464a7c
3 changed files with 22 additions and 1 deletions
|
@ -1037,7 +1037,7 @@ _notmuch_message_set_header_values (notmuch_message_t *message,
|
|||
if (date == NULL || *date == '\0') {
|
||||
time_value = 0;
|
||||
} else {
|
||||
time_value = g_mime_utils_header_decode_date (date, NULL);
|
||||
time_value = g_mime_utils_header_decode_date_unix (date);
|
||||
/*
|
||||
* Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=779923
|
||||
*/
|
||||
|
|
|
@ -99,6 +99,11 @@ g_mime_signature_status_error (GMimeSignatureError error) {
|
|||
return (error != GMIME_SIGNATURE_ERROR_NONE);
|
||||
}
|
||||
|
||||
time_t
|
||||
g_mime_utils_header_decode_date_unix (const char *date) {
|
||||
return g_mime_utils_header_decode_date (date, NULL);
|
||||
}
|
||||
|
||||
#else /* GMime >= 3.0 */
|
||||
|
||||
char *
|
||||
|
@ -166,5 +171,19 @@ g_mime_signature_status_error (GMimeSignatureStatus status) {
|
|||
return (status & GMIME_SIGNATURE_STATUS_ERROR_MASK);
|
||||
}
|
||||
|
||||
gint64
|
||||
g_mime_utils_header_decode_date_unix (const char *date) {
|
||||
GDateTime* parsed_date = g_mime_utils_header_decode_date (date);
|
||||
time_t ret;
|
||||
|
||||
if (parsed_date) {
|
||||
ret = g_date_time_to_unix (parsed_date);
|
||||
g_date_time_unref (parsed_date);
|
||||
} else {
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -94,4 +94,6 @@ gboolean g_mime_signature_status_good (GMimeSignatureStatus status);
|
|||
gboolean g_mime_signature_status_bad (GMimeSignatureStatus status);
|
||||
|
||||
gboolean g_mime_signature_status_error (GMimeSignatureError status);
|
||||
|
||||
gint64 g_mime_utils_header_decode_date_unix (const char *date);
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue