[PATCH 5/6] lib/message-file: stash pointer to "parent" notmuch database

Subject: [PATCH 5/6] lib/message-file: stash pointer to "parent" notmuch database

Date: Sat, 5 Feb 2022 15:52:14 -0400

To: notmuch@notmuchmail.org

Cc:

From: David Bremner


Since we know the database anyway when creating the
notmuch_message_file struct, keep it to e.g. retrieve configuration
information later.
---
 lib/message-file.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/message-file.c b/lib/message-file.c
index 68f646a4..0f356cf1 100644
--- a/lib/message-file.c
+++ b/lib/message-file.c
@@ -27,6 +27,7 @@
 #include <glib.h> /* GHashTable */
 
 struct _notmuch_message_file {
+    notmuch_database_t *notmuch;
     /* open stream to (possibly gzipped) file */
     GMimeStream *stream;
     char *filename;
@@ -90,6 +91,8 @@ _notmuch_message_file_open_ctx (notmuch_database_t *notmuch,
     if (message->stream == NULL)
 	goto FAIL;
 
+    message->notmuch = notmuch;
+
     return message;
 
   FAIL:
-- 
2.34.1

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: