X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fbrowse.c;h=85a64b19acfc34cf77f44db30ad022a559a91270;hp=96eb8b995dfe77500b990758dc61532ceb96e935;hb=819c071fa7efc8dffb4dd92f36f0111227ff692f;hpb=230399f9632c37b66c1c117a17e8327eae6b3235 diff --git a/imap/browse.c b/imap/browse.c index 96eb8b9..85a64b1 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -10,18 +10,8 @@ /* Mutt browser support routines */ -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include - #include -#include - - #include "mutt.h" #include "imap_private.h" @@ -71,7 +61,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" : "string_list_t"); + option(OPTIMAPLSUB) ? "LSUB" : "LIST"); if (!(idata = imap_conn_find (&(mx.account), 0))) goto fail; @@ -79,7 +69,6 @@ int imap_browse (char *path, struct browser_state *state) if (!mx.mbox) { home_namespace = 1; mbox[0] = '\0'; /* Do not replace "" with "INBOX" here */ - mx.mbox = m_strdup(ImapHomeNamespace); if (mutt_bit_isset (idata->capabilities, NAMESPACE)) { mutt_message _("Getting namespaces..."); @@ -120,8 +109,7 @@ int imap_browse (char *path, struct browser_state *state) mbox[n] = '\0'; } } - } - while (ascii_strncmp (idata->cmd.buf, idata->cmd.seq, SEQLEN)); + } while (m_strncmp(idata->cmd.buf.data, idata->cmd.seq, SEQLEN)); } /* if we're descending a folder, mark it as current in browser_state */ @@ -187,7 +175,7 @@ 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. */ - if (browse_add_list_result (idata, "string_list_t \"\" \"INBOX\"", state, 0)) + if (browse_add_list_result (idata, "LIST \"\" \"INBOX\"", state, 0)) goto fail; } @@ -285,7 +273,7 @@ int imap_mailbox_rename (const char *mailbox) IMAP_DATA *idata; IMAP_MBOX mx; char buf[LONG_STRING]; - char newname[SHORT_STRING]; + char newname[STRING]; if (imap_parse_path (mailbox, &mx) < 0) { return -1; @@ -307,7 +295,8 @@ int imap_mailbox_rename (const char *mailbox) } if (imap_rename_mailbox (idata, &mx, newname) < 0) { - mutt_error (_("Rename failed: %s"), imap_get_qualifier (idata->cmd.buf)); + mutt_error (_("Rename failed: %s"), + imap_get_qualifier(idata->cmd.buf.data)); mutt_sleep (1); goto fail; } @@ -354,8 +343,7 @@ static int browse_add_list_result (IMAP_DATA * idata, const char *cmd, imap_add_folder (idata->delim, name, noselect, noinferiors, state, isparent); } - } - while ((ascii_strncmp (idata->cmd.buf, idata->cmd.seq, SEQLEN) != 0)); + } while ((m_strncmp(idata->cmd.buf.data, idata->cmd.seq, SEQLEN) != 0)); p_delete(&mx.mbox); return 0; @@ -394,7 +382,7 @@ static void imap_add_folder (char delim, char *folder, int noselect, /* apply filemask filter. This should really be done at menu setup rather * than at scan, since it's so expensive to scan. But that's big changes * to browser.c */ - if (!((regexec (Mask.rx, relpath, 0, NULL, 0) == 0) ^ Mask.not)) { + if (!((regexec (Mask.rx, relpath, 0, NULL, 0) == 0) ^ Mask.neg)) { p_delete(&mx.mbox); return; } @@ -448,7 +436,7 @@ static int browse_get_namespace (IMAP_DATA * idata, char *nsbuf, int nsblen, if ((rc = imap_cmd_step (idata)) != IMAP_CMD_CONTINUE) break; - s = imap_next_word (idata->cmd.buf); + s = imap_next_word (idata->cmd.buf.data); if (ascii_strncasecmp ("NAMESPACE", s, 9) == 0) { /* There are three sections to the response, User, Other, Shared, * and maybe more by extension */ @@ -536,11 +524,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" : "string_list_t", nsi->prefix, + option (OPTIMAPLSUB) ? "LSUB" : "LIST", nsi->prefix, nsi->delim); else snprintf (buf, sizeof (buf), "%s \"\" \"%s%%\"", - option (OPTIMAPLSUB) ? "LSUB" : "string_list_t", nsi->prefix); + option (OPTIMAPLSUB) ? "LSUB" : "LIST", nsi->prefix); imap_cmd_start (idata, buf); @@ -551,8 +539,7 @@ static int browse_verify_namespace (IMAP_DATA * idata, &nsi->noinferiors, &delim) != 0) return -1; nsi->listable |= (name != NULL); - } - while ((ascii_strncmp (idata->cmd.buf, idata->cmd.seq, SEQLEN) != 0)); + } while ((m_strncmp(idata->cmd.buf.data, idata->cmd.seq, SEQLEN) != 0)); } return 0;