+static void cmd_parse_lsub (IMAP_DATA* idata, char* s) {
+ char buf[STRING];
+ ciss_url_t url;
+ char *ep;
+
+ if (!option (OPTIMAPCHECKSUBSCRIBED))
+ return;
+
+ s = imap_next_word (s); /* flags */
+
+ if (*s != '(') {
+ return;
+ }
+
+ s++;
+ ep = s;
+ for (ep = s; *ep && *ep != ')'; ep++);
+ do {
+ if (!ascii_strncasecmp (s, "\\NoSelect", 9))
+ return;
+ while (s < ep && *s != ' ' && *s != ')')
+ s++;
+ if (*s == ' ')
+ s++;
+ } while (s != ep);
+
+ s = imap_next_word (s); /* delim */
+ s = imap_next_word (s); /* name */
+
+ if (s) {
+ imap_unmunge_mbox_name (s);
+
+ mutt_account_tourl(&idata->conn->account, &url);
+ url.path = s;
+ if (!m_strcmp(url.user, ImapUser))
+ url.user = NULL;
+ url_ciss_tostring(&url, buf, sizeof(buf), 0);
+ buffy_do_mailboxes(buf, 1);
+ }
+}
+