Rocco Rutte:
[apps/madmutt.git] / imap / browse.c
index 0f23e21..1410829 100644 (file)
@@ -60,6 +60,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 +68,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 +226,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;
 }