]> granicus.if.org Git - neomutt/commitdiff
factor Folder out of imap_pretty_mailbox
authorRichard Russon <rich@flatcap.org>
Fri, 24 Aug 2018 16:05:55 +0000 (17:05 +0100)
committerRichard Russon <rich@flatcap.org>
Sun, 26 Aug 2018 21:11:03 +0000 (22:11 +0100)
imap/imap.h
imap/util.c
muttlib.c

index fc047fc2232452999bea91d1d9ce4442f3602690..2964d9df41787f93b098f27ef207460c4f295cc5 100644 (file)
@@ -110,7 +110,7 @@ void imap_logout_all(void);
 /* util.c */
 int imap_expand_path(char *buf, size_t buflen);
 int imap_parse_path(const char *path, struct ImapMbox *mx);
-void imap_pretty_mailbox(char *path);
+void imap_pretty_mailbox(char *path, const char *folder);
 
 int imap_wait_keepalive(pid_t pid);
 void imap_keepalive(void);
index 689b9f19396fd963c282e1e8d3c11ca329812f18..ad7445924f954ebdf710865b6f0894ab5a0bf830 100644 (file)
@@ -498,11 +498,12 @@ int imap_mxcmp(const char *mx1, const char *mx2)
 
 /**
  * imap_pretty_mailbox - Prettify an IMAP mailbox name
- * @param path Mailbox name to be tidied
+ * @param path   Mailbox name to be tidied
+ * @param folder Path to use for '+' abbreviations
  *
  * Called by mutt_pretty_mailbox() to make IMAP paths look nice.
  */
-void imap_pretty_mailbox(char *path)
+void imap_pretty_mailbox(char *path, const char *folder)
 {
   struct ImapMbox home, target;
   struct Url url;
@@ -516,7 +517,7 @@ void imap_pretty_mailbox(char *path)
 
   tlen = mutt_str_strlen(target.mbox);
   /* check whether we can do '=' substitution */
-  if (mx_is_imap(Folder) && !imap_parse_path(Folder, &home))
+  if (mx_is_imap(folder) && !imap_parse_path(folder, &home))
   {
     hlen = mutt_str_strlen(home.mbox);
     if (tlen && mutt_account_match(&home.account, &target.account) &&
index 22a10717df44ed5825b9d555650ee3a163c83c99..f6829d5622b3dec36e329e479eb1aa036eeafb96 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -557,7 +557,7 @@ void mutt_pretty_mailbox(char *buf, size_t buflen)
 #ifdef USE_IMAP
   if (scheme == U_IMAP || scheme == U_IMAPS)
   {
-    imap_pretty_mailbox(buf);
+    imap_pretty_mailbox(buf, Folder);
     return;
   }
 #endif