]> granicus.if.org Git - neomutt/commitdiff
imap: drop mdata->ctx
authorRichard Russon <rich@flatcap.org>
Sun, 23 Dec 2018 00:14:10 +0000 (00:14 +0000)
committerRichard Russon <rich@flatcap.org>
Sat, 5 Jan 2019 14:44:35 +0000 (14:44 +0000)
imap/imap.c
imap/imap_private.h

index 58e3ff40e4a485b15c8e73ad8d35f9113f6cffc6..86fae0bef18a0ad6cce12e0562b9cc69ce641187 100644 (file)
@@ -1960,12 +1960,6 @@ static int imap_mbox_open(struct Mailbox *m, struct Context *ctx)
   struct ImapAccountData *adata = imap_adata_get(m);
   struct ImapMboxData *mdata = imap_mdata_get(m);
 
-  // NOTE(sileht): looks like we have two not obvious loop here
-  // ctx->mailbox->account->mdata->ctx
-  // mailbox->account->adata->mailbox
-  // this is used only by imap_mbox_close() to detect if the
-  // adata/mailbox is a normal or append one, looks a bit dirty
-  mdata->ctx = ctx;
   adata->mailbox = m;
 
   /* clear mailbox status */
@@ -2237,8 +2231,7 @@ static int imap_mbox_close(struct Mailbox *m)
     return 0;
 
   /* imap_mbox_open_append() borrows the struct ImapAccountData temporarily,
-   * just for the connection, but does not set mdata->ctx to the
-   * open-append ctx.
+   * just for the connection.
    *
    * So when these are equal, it means we are actually closing the
    * mailbox and should clean up adata.  Otherwise, we don't want to
@@ -2259,8 +2252,6 @@ static int imap_mbox_close(struct Mailbox *m)
     }
 
     adata->mailbox = NULL;
-    mdata->ctx = NULL;
-
     imap_mdata_cache_reset(m->mdata);
   }
 
index 2d62ffba4f38999eb44dc8e2f181df1f7b691c3c..d64fa4524a4986c7062cf15ee4f17cb633cc2cbe 100644 (file)
@@ -34,7 +34,6 @@
 #include "hcache/hcache.h"
 #endif
 
-struct Context;
 struct Email;
 struct ImapEmailData;
 struct Mailbox;
@@ -240,8 +239,6 @@ struct ImapMboxData
   unsigned int max_msn;        /**< the largest MSN fetched so far */
   struct BodyCache *bcache;
 
-  struct Context *ctx;
-
 #ifdef USE_HCACHE
   header_cache_t *hcache;
 #endif