feat(third_party/notmuch): Patch notmuch to render time as dottime

This implements support for dotti.me in notmuch by changing the
formatting of relative and absolute times.
This commit is contained in:
Vincent Ambo 2019-12-27 19:16:53 +01:00
parent 08dd267c19
commit 1ea6dcabbb
2 changed files with 29 additions and 0 deletions

View file

@ -1,5 +1,6 @@
{ pkgs, ... }:
pkgs.third_party.originals.notmuch.overrideAttrs(old: {
doCheck = false;
patches = [ ./dottime.patch ] ++ (if old ? patches then old.patches else []);
})

View file

@ -33,3 +33,31 @@ index 2734b36a..b1ec4bdc 100644
return result;
}
}
diff --git a/util/gmime-extra.c b/util/gmime-extra.c
index d1bb1d47..9df5a454 100644
--- a/util/gmime-extra.c
+++ b/util/gmime-extra.c
@@ -124,7 +124,10 @@ g_mime_message_get_date_string (void *ctx, GMimeMessage *message)
{
GDateTime* parsed_date = g_mime_message_get_date (message);
if (parsed_date) {
- char *date = g_mime_utils_header_format_date (parsed_date);
+ char *date = g_date_time_format(
+ parsed_date,
+ "%a, %d %b %Y %H·%M%z"
+ );
return g_string_talloc_strdup (ctx, date);
} else {
return talloc_strdup(ctx, "Thu, 01 Jan 1970 00:00:00 +0000");
diff --git a/util/gmime-extra.h b/util/gmime-extra.h
index b0c8d3d8..40f748f8 100644
--- a/util/gmime-extra.h
+++ b/util/gmime-extra.h
@@ -1,5 +1,7 @@
#ifndef _GMIME_EXTRA_H
#define _GMIME_EXTRA_H
+#include <glib.h>
+#include <glib/gprintf.h>
#include <gmime/gmime.h>
#include <talloc.h>