collapse_all(menu, 0);
#ifdef USE_SIDEBAR
- mutt_sb_set_open_mailbox();
+ mutt_sb_set_open_mailbox(Context ? Context->mailbox : NULL);
#endif
mutt_clear_error();
#endif
mutt_buffer_expand_path(folderbuf);
#ifdef USE_SIDEBAR
- mutt_sb_set_open_mailbox();
+ mutt_sb_set_open_mailbox(Context ? Context->mailbox : NULL);
#endif
goto changefoldercleanup;
if (Context || !explicit_folder)
{
#ifdef USE_SIDEBAR
- mutt_sb_set_open_mailbox();
+ mutt_sb_set_open_mailbox(Context ? Context->mailbox : NULL);
#endif
mutt_index_menu();
ctx_free(&Context);
}
/**
- * mutt_sb_set_open_mailbox - Set the OpnMailbox based on the global Context
+ * mutt_sb_set_open_mailbox - Set the 'open' Mailbox
+ * @param m Mailbox
*
- * Search through the list of mailboxes. If a Mailbox has a matching path, set
- * OpnMailbox to it.
+ * Search through the list of mailboxes.
+ * If a Mailbox has a matching path, set OpnMailbox to it.
*/
-void mutt_sb_set_open_mailbox(void)
+void mutt_sb_set_open_mailbox(struct Mailbox *m)
{
OpnIndex = -1;
- if (!Context)
+ if (!m)
return;
for (int entry = 0; entry < EntryCount; entry++)
{
- if (mutt_str_strcmp(Entries[entry]->mailbox->realpath, Context->mailbox->realpath) == 0)
+ if (mutt_str_strcmp(Entries[entry]->mailbox->realpath, m->realpath) == 0)
{
OpnIndex = entry;
HilIndex = entry;
void mutt_sb_draw(void);
struct Mailbox *mutt_sb_get_highlight(void);
void mutt_sb_notify_mailbox(struct Mailbox *m, bool created);
-void mutt_sb_set_open_mailbox(void);
+void mutt_sb_set_open_mailbox(struct Mailbox *m);
#endif /* MUTT_SIDEBAR_H */