imap: rename mailbox out of the way
authorRichard Russon <rich@flatcap.org>
Sun, 9 Sep 2018 01:40:21 +0000 (02:40 +0100)
committerRichard Russon <rich@flatcap.org>
Sun, 9 Sep 2018 15:13:35 +0000 (16:13 +0100)
imap/command.c
imap/imap.c
imap/imap_private.h
imap/message.c
maildir/mh.c
notmuch/mutt_notmuch.c

index b7c97a15c8440c1c51d8df6da8d90411539804a0..59b5ba23faea4e998749938b1a11044c053da327 100644 (file)
@@ -1002,7 +1002,7 @@ static int cmd_handle_untagged(struct ImapData *idata)
       {
         if (!(idata->reopen & IMAP_EXPUNGE_PENDING))
         {
-          mutt_debug(2, "New mail in %s - %d messages total.\n", idata->mailbox, count);
+          mutt_debug(2, "New mail in %s - %d messages total.\n", idata->mbox_name, count);
           idata->reopen |= IMAP_NEWMAIL_PENDING;
         }
         idata->new_mail_count = count;
index 106912242c083a469ab3de7447b566c5bb53edbd..5a5d1795d64f85b5faf7bd9fdaa23d214c3d7c86 100644 (file)
@@ -619,7 +619,7 @@ int imap_access(const char *path)
     mutt_str_strfcpy(mailbox, "INBOX", sizeof(mailbox));
 
   /* we may already be in the folder we're checking */
-  if (mutt_str_strcmp(idata->mailbox, mx.mbox) == 0)
+  if (mutt_str_strcmp(idata->mbox_name, mx.mbox) == 0)
   {
     FREE(&mx.mbox);
     return 0;
@@ -1473,7 +1473,7 @@ int imap_mailbox_check(bool check_stats)
      * IDLEd elsewhere.
      * idata->mailbox may be NULL for connections other than the current
      * mailbox's, and shouldn't expand to INBOX in that case. #3216. */
-    if (idata->mailbox && (imap_mxcmp(name, idata->mailbox) == 0))
+    if (idata->mbox_name && (imap_mxcmp(name, idata->mbox_name) == 0))
     {
       np->m->has_new = false;
       continue;
@@ -1560,7 +1560,7 @@ int imap_status(const char *path, bool queue)
    *
    * Note that imap_mxcmp() converts NULL to "INBOX", so we need to
    * make sure the idata really is open to a folder. */
-  if (idata->ctx && !imap_mxcmp(buf, idata->mailbox))
+  if (idata->ctx && !imap_mxcmp(buf, idata->mbox_name))
     return idata->ctx->mailbox->msg_count;
   else if (mutt_bit_isset(idata->capabilities, IMAP4REV1) ||
            mutt_bit_isset(idata->capabilities, STATUS))
@@ -2027,9 +2027,9 @@ static int imap_mbox_open(struct Context *ctx)
   imap_fix_path(idata, mx.mbox, buf, sizeof(buf));
   if (!*buf)
     mutt_str_strfcpy(buf, "INBOX", sizeof(buf));
-  FREE(&(idata->mailbox));
-  idata->mailbox = mutt_str_strdup(buf);
-  imap_qualify_path(buf, sizeof(buf), &mx, idata->mailbox);
+  FREE(&(idata->mbox_name));
+  idata->mbox_name = mutt_str_strdup(buf);
+  imap_qualify_path(buf, sizeof(buf), &mx, idata->mbox_name);
 
   mutt_str_strfcpy(ctx->mailbox->path, buf, sizeof(ctx->mailbox->path));
   mutt_str_strfcpy(ctx->mailbox->realpath, ctx->mailbox->path,
@@ -2043,8 +2043,8 @@ static int imap_mbox_open(struct Context *ctx)
   idata->new_mail_count = 0;
   idata->max_msn = 0;
 
-  mutt_message(_("Selecting %s..."), idata->mailbox);
-  imap_munge_mbox_name(idata, buf, sizeof(buf), idata->mailbox);
+  mutt_message(_("Selecting %s..."), idata->mbox_name);
+  imap_munge_mbox_name(idata, buf, sizeof(buf), idata->mbox_name);
 
   /* pipeline ACL test */
   if (mutt_bit_isset(idata->capabilities, ACL))
@@ -2090,7 +2090,7 @@ static int imap_mbox_open(struct Context *ctx)
 
   imap_cmd_start(idata, bufout);
 
-  status = imap_mboxcache_get(idata, idata->mailbox, true);
+  status = imap_mboxcache_get(idata, idata->mbox_name, true);
 
   do
   {
@@ -2320,7 +2320,7 @@ static int imap_mbox_close(struct Context *ctx)
     }
 
     idata->reopen &= IMAP_REOPEN_ALLOW;
-    FREE(&(idata->mailbox));
+    FREE(&(idata->mbox_name));
     mutt_list_free(&idata->flags);
     idata->ctx = NULL;
 
index dd9d84095c86ca596946dc507b7a4b6effba742b..d538a19bd1b04f729a53ea89e4f585dfbb14ff9f 100644 (file)
@@ -251,7 +251,7 @@ struct ImapData
   /* The following data is all specific to the currently SELECTED mbox */
   char delim;
   struct Context *ctx;
-  char *mailbox;
+  char *mbox_name;
   unsigned short check_status;
   unsigned char reopen;
   unsigned int new_mail_count; /**< Set when EXISTS notifies of new mail */
index 2fce597bfe5c1c111c236790fc1aa99a561b5ef9..c609afc6de42ea5d6c96e9045a98a6191e3b0573 100644 (file)
@@ -91,7 +91,7 @@ static struct BodyCache *msg_cache_open(struct ImapData *idata)
   if (idata->bcache)
     return idata->bcache;
 
-  imap_cachepath(idata, idata->mailbox, mailbox, sizeof(mailbox));
+  imap_cachepath(idata, idata->mbox_name, mailbox, sizeof(mailbox));
 
   return mutt_bcache_open(&idata->conn->account, mailbox);
 }
@@ -1267,7 +1267,7 @@ int imap_read_headers(struct ImapData *idata, unsigned int msn_begin,
   if (read_headers_fetch_new(idata, msn_begin, msn_end, evalhc, &maxuid, initial_download) < 0)
     goto bail;
 
-  if (maxuid && (status = imap_mboxcache_get(idata, idata->mailbox, 0)) &&
+  if (maxuid && (status = imap_mboxcache_get(idata, idata->mbox_name, 0)) &&
       (status->uidnext < maxuid + 1))
   {
     status->uidnext = maxuid + 1;
index 1a0b6cc2ccdcb2977333a5f7b2f5889a2cc4d024..4819e1595bc9ee9d9f41be17f9ffc146f410666a 100644 (file)
@@ -1609,7 +1609,7 @@ static int mh_mbox_open_append(struct Context *ctx, int flags)
  *
  * Open a new (temporary) message in an MH folder.
  */
-static int mh_msg_open_new(struct Context *ctx, struct Message *msg, struct Header *hdr) 
+static int mh_msg_open_new(struct Context *ctx, struct Message *msg, struct Header *hdr)
 {
   return mh_mkstemp(ctx->mailbox, &msg->fp, &msg->path);
 }
index 797891105bcf2c1eb97ace9e372264e6acf81a7a..def3f0ef96c9ff82aff8946f49b1855513e2face 100644 (file)
@@ -1316,7 +1316,8 @@ static bool read_mesgs_query(struct Mailbox *mailbox, notmuch_query_t *q, bool d
  * @retval true  Success
  * @retval false Failure
  */
-static bool read_threads_query(struct Mailbox *mailbox, notmuch_query_t *q, bool dedup, int limit)
+static bool read_threads_query(struct Mailbox *mailbox, notmuch_query_t *q,
+                               bool dedup, int limit)
 {
   struct NmMboxData *data = get_mboxdata(mailbox);
   notmuch_threads_t *threads = NULL;
@@ -1334,8 +1335,7 @@ static bool read_threads_query(struct Mailbox *mailbox, notmuch_query_t *q, bool
   threads = notmuch_query_search_threads(q);
 #endif
 
-  for (; notmuch_threads_valid(threads) &&
-         ((limit == 0) || (mailbox->msg_count < limit));
+  for (; notmuch_threads_valid(threads) && ((limit == 0) || (mailbox->msg_count < limit));
        notmuch_threads_move_to_next(threads))
   {
     if (SigInt == 1)
@@ -2165,8 +2165,8 @@ bool nm_message_is_still_queried(struct Mailbox *mailbox, struct Header *hdr)
  * @retval  0 Success
  * @retval -1 Failure
  */
-int nm_update_filename(struct Mailbox *mailbox, const char *old, const char *new,
-                       struct Header *h)
+int nm_update_filename(struct Mailbox *mailbox, const char *old,
+                       const char *new, struct Header *h)
 {
   char buf[PATH_MAX];
   int rc;