]> granicus.if.org Git - neomutt/commitdiff
open_append: remove Context
authorRichard Russon <rich@flatcap.org>
Tue, 13 Nov 2018 01:29:36 +0000 (01:29 +0000)
committerRichard Russon <rich@flatcap.org>
Wed, 14 Nov 2018 16:35:55 +0000 (16:35 +0000)
compress.c
imap/imap.c
maildir/mh.c
mbox/mbox.c
mx.c
mx.h

index 018c35ad8a308a33f491ae5d0392e5cdedaebb19..e0cf240136524f10fe60f5bbf38e56471fbdb823 100644 (file)
@@ -558,12 +558,8 @@ cmo_fail:
  * To append to a compressed mailbox we need an append-hook (or both open- and
  * close-hooks).
  */
-static int comp_mbox_open_append(struct Context *ctx, int flags)
+static int comp_mbox_open_append(struct Mailbox *m, int flags)
 {
-  if (!ctx)
-    return -1;
-
-  struct Mailbox *m = ctx->mailbox;
   if (!m)
     return -1;
 
@@ -618,7 +614,7 @@ static int comp_mbox_open_append(struct Context *ctx, int flags)
     goto cmoa_fail2;
   }
 
-  if (ci->child_ops->mbox_open_append(ctx, flags) != 0)
+  if (ci->child_ops->mbox_open_append(m, flags) != 0)
     goto cmoa_fail2;
 
   return 0;
index 28fb512b6543ce0d167b185bf0cb238ff0384263..fca90efc2f0790c984690d47f381d7786b0b736c 100644 (file)
@@ -2488,12 +2488,8 @@ fail:
 /**
  * imap_mbox_open_append - Implements MxOps::mbox_open_append()
  */
-static int imap_mbox_open_append(struct Context *ctx, int flags)
+static int imap_mbox_open_append(struct Mailbox *m, int flags)
 {
-  if (!ctx)
-    return -1;
-
-  struct Mailbox *m = ctx->mailbox;
   if (!m)
     return -1;
 
index 901146b2e18bdd10b6647a540863f102d6534583..6cb51f02e76e851770faa59370209e65e52a670f 100644 (file)
@@ -2388,12 +2388,8 @@ static int maildir_mbox_open(struct Context *ctx)
 /**
  * maildir_mbox_open_append - Implements MxOps::mbox_open_append()
  */
-static int maildir_mbox_open_append(struct Context *ctx, int flags)
+static int maildir_mbox_open_append(struct Mailbox *m, int flags)
 {
-  if (!ctx)
-    return -1;
-
-  struct Mailbox *m = ctx->mailbox;
   if (!m)
     return -1;
 
@@ -2821,12 +2817,8 @@ static int mh_mbox_open(struct Context *ctx)
 /**
  * mh_mbox_open_append - Implements MxOps::mbox_open_append()
  */
-static int mh_mbox_open_append(struct Context *ctx, int flags)
+static int mh_mbox_open_append(struct Mailbox *m, int flags)
 {
-  if (!ctx)
-    return -1;
-
-  struct Mailbox *m = ctx->mailbox;
   if (!m)
     return -1;
 
index f0f3d0b24fffa71a914bf235b5471adf2d1fff08..c3745d9068b36004aadd3021db48381a04865c8d 100644 (file)
@@ -983,12 +983,8 @@ static int mbox_mbox_open(struct Context *ctx)
 /**
  * mbox_mbox_open_append - Implements MxOps::mbox_open_append()
  */
-static int mbox_mbox_open_append(struct Context *ctx, int flags)
+static int mbox_mbox_open_append(struct Mailbox *m, int flags)
 {
-  if (!ctx)
-    return -1;
-
-  struct Mailbox *m = ctx->mailbox;
   if (!m)
     return -1;
 
diff --git a/mx.c b/mx.c
index 5d1acce6ed476ef778123642dc2b6a94db250e0c..13f0942e8c8f763775d48d866759aae1e62d10ee 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -233,7 +233,7 @@ static int mx_open_mailbox_append(struct Context *ctx, int flags)
   if (!m->mx_ops || !m->mx_ops->mbox_open_append)
     return -1;
 
-  return m->mx_ops->mbox_open_append(ctx, flags);
+  return m->mx_ops->mbox_open_append(ctx->mailbox, flags);
 }
 
 /**
diff --git a/mx.h b/mx.h
index f55ae6a376322a62b83b207d841cb615394a3ad4..13d1408b3db06bf080b174543932a96fcafe1de4 100644 (file)
--- a/mx.h
+++ b/mx.h
@@ -127,12 +127,12 @@ struct MxOps
   int (*mbox_open)       (struct Context *ctx);
   /**
    * mbox_open_append - Open a mailbox for appending
-   * @param ctx   Mailbox to open
+   * @param m     Mailbox to open
    * @param flags e.g. #MUTT_READONLY
    * @retval  0 Success
    * @retval -1 Failure
    */
-  int (*mbox_open_append)(struct Context *ctx, int flags);
+  int (*mbox_open_append)(struct Mailbox *m, int flags);
   /**
    * mbox_check - Check for new mail
    * @param ctx Mailbox