diff options
author | Vincent Ambo <tazjin@google.com> | 2019-12-27T18·16+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2019-12-27T18·18+0100 |
commit | 1ea6dcabbb097ab7f4f57630c41f58b4df549095 (patch) | |
tree | eace0b878700a7d268ce668db826053c2a3dca2a /third_party/notmuch | |
parent | 08dd267c19fcc224a48c2f5a5c0dacb7f8b8acea (diff) |
feat(third_party/notmuch): Patch notmuch to render time as dottime r/315
This implements support for dotti.me in notmuch by changing the formatting of relative and absolute times.
Diffstat (limited to 'third_party/notmuch')
-rw-r--r-- | third_party/notmuch/default.nix | 1 | ||||
-rw-r--r-- | third_party/notmuch/dottime.patch | 28 |
2 files changed, 29 insertions, 0 deletions
diff --git a/third_party/notmuch/default.nix b/third_party/notmuch/default.nix index 3d45031a82a8..ddb764b0ae46 100644 --- a/third_party/notmuch/default.nix +++ b/third_party/notmuch/default.nix @@ -1,5 +1,6 @@ { pkgs, ... }: pkgs.third_party.originals.notmuch.overrideAttrs(old: { + doCheck = false; patches = [ ./dottime.patch ] ++ (if old ? patches then old.patches else []); }) diff --git a/third_party/notmuch/dottime.patch b/third_party/notmuch/dottime.patch index 147ee3b4118b..c9e0159ca242 100644 --- a/third_party/notmuch/dottime.patch +++ b/third_party/notmuch/dottime.patch @@ -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> + |