This changes return type in gmime 3.0
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
*/
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 *
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
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