]> granicus.if.org Git - neomutt/commitdiff
notmuch: factor out Context
authorRichard Russon <rich@flatcap.org>
Wed, 21 Nov 2018 14:18:48 +0000 (14:18 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 22 Nov 2018 13:45:24 +0000 (13:45 +0000)
notmuch/mutt_notmuch.c

index 1ac8221d93ed64a0fdd6223471246273fc4adfd9..9615dff3b74ef26b6a12b10c9f20116388c2de2a 100644 (file)
@@ -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);