Make buffy a lua package as well.
[apps/madmutt.git] / imap / command.c
index bf21c4b..c33776b 100644 (file)
@@ -16,6 +16,7 @@
 #include <lib-mx/mx.h>
 
 #include "mutt.h"
+#include "buffy.h"
 #include "message.h"
 #include "imap_private.h"
 
@@ -485,8 +486,6 @@ static void cmd_parse_fetch (IMAP_DATA * idata, char *s)
 
 static void cmd_parse_lsub (IMAP_DATA* idata, char* s) {
   char buf[STRING];
-  char errstr[STRING];
-  BUFFER err, token;
   ciss_url_t url;
   char *ep;
 
@@ -517,18 +516,12 @@ static void cmd_parse_lsub (IMAP_DATA* idata, char* s) {
   if (s) {
     imap_unmunge_mbox_name (s);
 
-    m_strcpy(buf, sizeof(buf), "mailboxes \"");
-    mutt_account_tourl (&idata->conn->account, &url);
+    mutt_account_tourl(&idata->conn->account, &url);
     url.path = s;
     if (!m_strcmp(url.user, ImapUser))
       url.user = NULL;
-    url_ciss_tostring (&url, buf + 11, sizeof (buf) - 10, 0);
-    m_strcat(buf, sizeof(buf), "\"");
-    p_clear(&token, 1);
-    err.data = errstr;
-    err.dsize = sizeof (errstr);
-    mutt_parse_rc_line (buf, &token, &err);
-    p_delete(&token.data);
+    url_ciss_tostring(&url, buf, sizeof(buf), 0);
+    buffy_do_mailboxes(buf, 1);
   }
 }