From 6cb29322c8c1d3fd717763872c8ce16e2c87adb4 Mon Sep 17 00:00:00 2001
From: Richard Russon <rich@flatcap.org>
Date: Wed, 21 Nov 2018 14:18:48 +0000
Subject: [PATCH] notmuch: factor out Context

---
 notmuch/mutt_notmuch.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/notmuch/mutt_notmuch.c b/notmuch/mutt_notmuch.c
index 1ac8221d9..9615dff3b 100644
--- a/notmuch/mutt_notmuch.c
+++ b/notmuch/mutt_notmuch.c
@@ -1252,7 +1252,7 @@ static int update_tags(notmuch_message_t *msg, const char *tags)
 
 /**
  * update_email_flags - Update the Email's flags
- * @param ctx Mailbox
+ * @param m   Mailbox
  * @param e   Email
  * @param tags String of tags (space separated)
  * @retval  0 Success
@@ -1262,7 +1262,7 @@ static int update_tags(notmuch_message_t *msg, const char *tags)
  * update_email_tags and update_email_flags, which are given an array of
  * tags.
  */
-static int update_email_flags(struct Context *ctx, struct Email *e, const char *tags)
+static int update_email_flags(struct Mailbox *m, struct Email *e, const char *tags)
 {
   char *buf = mutt_str_strdup(tags);
   if (!buf)
@@ -1290,21 +1290,21 @@ static int update_email_flags(struct Context *ctx, struct Email *e, const char *
     {
       tag = tag + 1;
       if (strcmp(tag, NmUnreadTag) == 0)
-        mutt_set_flag(ctx->mailbox, e, MUTT_READ, 1);
+        mutt_set_flag(m, e, MUTT_READ, 1);
       else if (strcmp(tag, NmRepliedTag) == 0)
-        mutt_set_flag(ctx->mailbox, e, MUTT_REPLIED, 0);
+        mutt_set_flag(m, e, MUTT_REPLIED, 0);
       else if (strcmp(tag, NmFlaggedTag) == 0)
-        mutt_set_flag(ctx->mailbox, e, MUTT_FLAG, 0);
+        mutt_set_flag(m, e, MUTT_FLAG, 0);
     }
     else
     {
       tag = (*tag == '+') ? tag + 1 : tag;
       if (strcmp(tag, NmUnreadTag) == 0)
-        mutt_set_flag(ctx->mailbox, e, MUTT_READ, 0);
+        mutt_set_flag(m, e, MUTT_READ, 0);
       else if (strcmp(tag, NmRepliedTag) == 0)
-        mutt_set_flag(ctx->mailbox, e, MUTT_REPLIED, 1);
+        mutt_set_flag(m, e, MUTT_REPLIED, 1);
       else if (strcmp(tag, NmFlaggedTag) == 0)
-        mutt_set_flag(ctx->mailbox, e, MUTT_FLAG, 1);
+        mutt_set_flag(m, e, MUTT_FLAG, 1);
     }
     end = NULL;
     tag = NULL;
@@ -2504,7 +2504,7 @@ static int nm_tags_commit(struct Context *ctx, struct Email *e, char *buf)
   mutt_debug(1, "nm: tags modify: '%s'\n", buf);
 
   update_tags(msg, buf);
-  update_email_flags(ctx, e, buf);
+  update_email_flags(m, e, buf);
   update_email_tags(e, msg);
   mutt_set_header_color(m, e);
 
-- 
2.40.0