]> granicus.if.org Git - neomutt/commitdiff
factor out Context from tags_edit()
authorRichard Russon <rich@flatcap.org>
Wed, 21 Nov 2018 14:45:46 +0000 (14:45 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 22 Nov 2018 13:45:24 +0000 (13:45 +0000)
index.c
mx.c
mx.h

diff --git a/index.c b/index.c
index 2e4d2bef279959eb145ba7b47c52a5c64e00ae8d..57a16d381a58054fb5199dbaeef3d12cd87cbfec 100644 (file)
--- a/index.c
+++ b/index.c
@@ -1972,7 +1972,7 @@ int mutt_index_menu(void)
         char *tags = NULL;
         if (!tag)
           tags = driver_tags_get_with_hidden(&CURHDR->tags);
-        rc = mx_tags_edit(Context, tags, buf, sizeof(buf));
+        rc = mx_tags_edit(Context->mailbox, tags, buf, sizeof(buf));
         FREE(&tags);
         if (rc < 0)
           break;
diff --git a/mx.c b/mx.c
index 8db72cd3df95e99e11a21655f95ed3e033e4dffb..1c53161fa21a9f14d1487f3f6966a111ec3785ff 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -1342,7 +1342,7 @@ int mx_check_empty(const char *path)
 
 /**
  * mx_tags_edit - start the tag editor of the mailbox
- * @param ctx    Mailbox
+ * @param m      Mailbox
  * @param tags   Existing tags
  * @param buf    Buffer for the results
  * @param buflen Length of the buffer
@@ -1350,13 +1350,11 @@ int mx_check_empty(const char *path)
  * @retval 0  No valid user input
  * @retval 1  Buffer set
  */
-int mx_tags_edit(struct Context *ctx, const char *tags, char *buf, size_t buflen)
+int mx_tags_edit(struct Mailbox *m, const char *tags, char *buf, size_t buflen)
 {
-  if (!ctx || !ctx->mailbox)
+  if (!m)
     return -1;
 
-  struct Mailbox *m = ctx->mailbox;
-
   if (m->mx_ops->tags_edit)
     return m->mx_ops->tags_edit(m, tags, buf, buflen);
 
diff --git a/mx.h b/mx.h
index e22cc1cc2c3a21279f5f062b97dbeae0ccf527d2..6a56901ccbe5ab98cb7f9ad2e6f6c54735732898 100644 (file)
--- a/mx.h
+++ b/mx.h
@@ -266,7 +266,7 @@ int             mx_path_parent     (char *buf, size_t buflen);
 int             mx_path_pretty     (char *buf, size_t buflen, const char *folder);
 enum MailboxType mx_path_probe     (const char *path, struct stat *st);
 int             mx_tags_commit     (struct Mailbox *m, struct Email *e, char *tags);
-int             mx_tags_edit       (struct Context *ctx, const char *tags, char *buf, size_t buflen);
+int             mx_tags_edit       (struct Mailbox *m, const char *tags, char *buf, size_t buflen);
 
 struct Account *mx_ac_find(struct Mailbox *m);
 struct Mailbox *mx_mbox_find(struct Account *a, const char *path);