From: Richard Russon Date: Fri, 24 Aug 2018 16:05:55 +0000 (+0100) Subject: factor Folder out of imap_pretty_mailbox X-Git-Tag: 2019-10-25~682^2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fb1f1cb998c4bbc0066f6036c47685c94878dd89;p=neomutt factor Folder out of imap_pretty_mailbox --- diff --git a/imap/imap.h b/imap/imap.h index fc047fc22..2964d9df4 100644 --- a/imap/imap.h +++ b/imap/imap.h @@ -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); diff --git a/imap/util.c b/imap/util.c index 689b9f193..ad7445924 100644 --- a/imap/util.c +++ b/imap/util.c @@ -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) && diff --git a/muttlib.c b/muttlib.c index 22a10717d..f6829d562 100644 --- 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