X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fbrowse.c;h=7cff939e595a40e8af730764574d890bc2e8cb41;hp=65f94f22262dfcbb7adf6553bf7a204f9d0632cc;hb=2293e9bc5a94ef33dc596b064c607d6bed5ad1fd;hpb=05a3bbbe420e4afc76e0eea24ce32f859405dc4a diff --git a/imap/browse.c b/imap/browse.c index 65f94f2..7cff939 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -21,7 +21,6 @@ #include #include #include -#include #include @@ -75,7 +74,7 @@ int imap_browse (char *path, struct browser_state *state) save_lsub = option (OPTIMAPCHECKSUBSCRIBED); unset_option (OPTIMAPCHECKSUBSCRIBED); m_strcpy(list_cmd, sizeof(list_cmd), - option(OPTIMAPLSUB) ? "LSUB" : "LIST"); + option(OPTIMAPLSUB) ? "LSUB" : "string_list_t"); if (!(idata = imap_conn_find (&(mx.account), 0))) goto fail; @@ -105,8 +104,6 @@ int imap_browse (char *path, struct browser_state *state) m_strcpy(mbox, sizeof(mbox), buf); n = m_strlen(mbox); - debug_print (3, ("mbox: %s\n", mbox)); - /* if our target exists and has inferiors, enter it if we * aren't already going to */ if (mbox[n - 1] != idata->delim) { @@ -154,7 +151,6 @@ int imap_browse (char *path, struct browser_state *state) mbox[n] = '\0'; if (showparents) { - debug_print (3, ("adding parent %s\n", mbox)); imap_add_folder (idata->delim, mbox, 1, 0, state, 1); } @@ -194,17 +190,14 @@ int imap_browse (char *path, struct browser_state *state) /* Listing the home namespace, so INBOX should be included. Home * namespace is not "", so we have to list it explicitly. We ask the * server to see if it has descendants. */ - debug_print (3, ("adding INBOX\n")); - if (browse_add_list_result (idata, "LIST \"\" \"INBOX\"", state, 0)) + if (browse_add_list_result (idata, "string_list_t \"\" \"INBOX\"", state, 0)) goto fail; } nsup = state->entrylen; - debug_print (3, ("Quoting mailbox scan: %s:\n", mbox)); snprintf (buf, sizeof (buf), "%s%%", mbox); imap_quote_string (buf2, sizeof (buf2), buf); - debug_print (3, ("%s\n", buf2)); snprintf (buf, sizeof (buf), "%s \"\" %s", list_cmd, buf2); if (browse_add_list_result (idata, buf, state, 0)) goto fail; @@ -225,7 +218,6 @@ int imap_browse (char *path, struct browser_state *state) if (nsi[i].listable && !nsi[i].home_namespace) { imap_add_folder (nsi[i].delim, nsi[i].prefix, nsi[i].noselect, nsi[i].noinferiors, state, 0); - debug_print (3, ("adding namespace: %s\n", nsi[i].prefix)); } } @@ -251,12 +243,10 @@ int imap_mailbox_create (const char *folder) short n; if (imap_parse_path (folder, &mx) < 0) { - debug_print (1, ("Bad starting path %s\n", folder)); return -1; } if (!(idata = imap_conn_find (&mx.account, M_IMAP_CONN_NONEW))) { - debug_print (1, ("Couldn't find open connection to %s\n", mx.account.host)); goto fail; } @@ -264,7 +254,7 @@ int imap_mailbox_create (const char *folder) /* append a delimiter if necessary */ n = m_strlen(buf); - if (n && (n < sizeof (buf) - 1) && (buf[n - 1] != idata->delim)) { + if (n && (n < ssizeof (buf) - 1) && (buf[n - 1] != idata->delim)) { buf[n++] = idata->delim; buf[n] = '\0'; } @@ -301,12 +291,10 @@ int imap_mailbox_rename (const char *mailbox) char newname[SHORT_STRING]; if (imap_parse_path (mailbox, &mx) < 0) { - debug_print (1, ("Bad source mailbox %s\n", mailbox)); return -1; } if (!(idata = imap_conn_find (&mx.account, M_IMAP_CONN_NONEW))) { - debug_print (1, ("Couldn't find open connection to %s\n", mx.account.host)); goto fail; } @@ -348,7 +336,6 @@ static int browse_add_list_result (IMAP_DATA * idata, const char *cmd, IMAP_MBOX mx; if (imap_parse_path (state->folder, &mx)) { - debug_print (2, ("current folder %s makes no sense\n", state->folder)); return -1; } @@ -419,7 +406,7 @@ static void imap_add_folder (char delim, char *folder, int noselect, (state->entry)[state->entrylen].name = m_strdup(tmp); /* mark desc with delim in browser if it can have subfolders */ - if (!isparent && !noinferiors && m_strlen(relpath) < sizeof (relpath) - 1) { + if (!isparent && !noinferiors && m_strlen(relpath) < ssizeof (relpath) - 1) { relpath[m_strlen(relpath) + 1] = '\0'; relpath[m_strlen(relpath)] = delim; } @@ -507,7 +494,6 @@ static int browse_get_namespace (IMAP_DATA * idata, char *nsbuf, int nsblen, } /* skip "" namespaces, they are already listed at the root */ if ((ns[0] != '\0') && (nsbused < nsblen) && (*nns < nsilen)) { - debug_print (3, ("adding %s\n", ns)); nsi->type = type; /* Cyrus doesn't append the delimiter to the namespace, * but UW-IMAP does. We'll strip it here and add it back @@ -553,11 +539,11 @@ static int browse_verify_namespace (IMAP_DATA * idata, * than invisible namespaces */ if (nsi->delim) snprintf (buf, sizeof (buf), "%s \"\" \"%s%c%%\"", - option (OPTIMAPLSUB) ? "LSUB" : "LIST", nsi->prefix, + option (OPTIMAPLSUB) ? "LSUB" : "string_list_t", nsi->prefix, nsi->delim); else snprintf (buf, sizeof (buf), "%s \"\" \"%s%%\"", - option (OPTIMAPLSUB) ? "LSUB" : "LIST", nsi->prefix); + option (OPTIMAPLSUB) ? "LSUB" : "string_list_t", nsi->prefix); imap_cmd_start (idata, buf);