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:
parent
08dd267c19
commit
1ea6dcabbb
2 changed files with 29 additions and 0 deletions
1
third_party/notmuch/default.nix
vendored
1
third_party/notmuch/default.nix
vendored
|
@ -1,5 +1,6 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
pkgs.third_party.originals.notmuch.overrideAttrs(old: {
|
||||
doCheck = false;
|
||||
patches = [ ./dottime.patch ] ++ (if old ? patches then old.patches else []);
|
||||
})
|
||||
|
|
28
third_party/notmuch/dottime.patch
vendored
28
third_party/notmuch/dottime.patch
vendored
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in a new issue