Rocco Rutte:
[apps/madmutt.git] / imap / browse.c
index 0f23e21..fd9c473 100644 (file)
@@ -23,6 +23,8 @@
 #include "lib/debug.h"
 
 #include "mutt.h"
+#include "ascii.h"
+#include "enter.h"
 #include "imap_private.h"
 
 /* -- forward declarations -- */
@@ -60,6 +62,7 @@ int imap_browse (char *path, struct browser_state *state)
   short showparents = 0;
   int noselect;
   int noinferiors;
+  int save_lsub;
   IMAP_MBOX mx;
 
   if (imap_parse_path (path, &mx)) {
@@ -67,6 +70,8 @@ int imap_browse (char *path, struct browser_state *state)
     return -1;
   }
 
+  save_lsub = option (OPTIMAPCHECKSUBSCRIBED);
+  unset_option (OPTIMAPCHECKSUBSCRIBED);
   strfcpy (list_cmd, option (OPTIMAPLSUB) ? "LSUB" : "LIST",
            sizeof (list_cmd));
 
@@ -223,10 +228,15 @@ int imap_browse (char *path, struct browser_state *state)
       }
   }
 
+  if (save_lsub)
+    set_option (OPTIMAPCHECKSUBSCRIBED);
+
   mem_free (&mx.mbox);
   return 0;
 
 fail:
+  if (save_lsub)
+    set_option (OPTIMAPCHECKSUBSCRIBED);
   mem_free (&mx.mbox);
   return -1;
 }