Show
Ignore:
Timestamp:
1999-07-20 01:05:32 (9 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Bugs fixed
* Mutt sometimes forgets that IMAP folders with new mail have new

mail.

* On some common IMAP servers, Mutt erroneously insists that the

current folder has new mail.

* Mutt constantly polls the server for new messages,

disregarding the imap_checkinterval option.

New features
* tab-completion of IMAP folders. Not yet namespace aware, though it

will work within an alternate namespace (eg won't complete #ft ->
#ftp, but will complete #ftp/pu -> #ftp/pub). Some tweaking of the
browser was necessary to get it to cooperate with completion.
Some remains to be done.

(From: From: Brendan Cully <brendan@…>)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • complete.c

    r842 r1111  
    1818 
    1919#include "mutt.h" 
     20#ifdef USE_IMAP 
     21#include "mailbox.h" 
     22#include "imap.h" 
     23#endif 
    2024 
    2125#include <dirent.h> 
     
    3943  char dirpart[_POSIX_PATH_MAX], exp_dirpart[_POSIX_PATH_MAX]; 
    4044  char filepart[_POSIX_PATH_MAX]; 
     45#ifdef USE_IMAP 
     46  char imap_path[LONG_STRING]; 
     47 
     48  dprint (2, (debugfile, "mutt_complete: completing %s\n", s)); 
     49 
     50  /* we can use '/' as a delimiter, imap_complete rewrites it */ 
     51  if (*s == '=' || *s == '+') 
     52  { 
     53    if (s[1]) 
     54      snprintf (imap_path, sizeof(imap_path), "%s/%s", NONULL(Maildir), 
     55                s+1); 
     56    else 
     57      strfcpy (imap_path, NONULL(Maildir), sizeof(imap_path)); 
     58  } 
     59  else 
     60  { 
     61    strfcpy (imap_path, s, sizeof(imap_path)); 
     62  } 
     63 
     64  if (mx_is_imap (imap_path)) 
     65  { 
     66    return imap_complete (s, imap_path); 
     67  } 
     68#endif 
    4169   
    4270  if (*s == '=' || *s == '+') 
     
    86114      dirpart[0] = 0; 
    87115      strfcpy (filepart, s, sizeof (filepart)); 
    88 #ifdef USE_IMAP 
    89       if (s[0] != '{') 
    90 #endif 
    91         dirp = opendir ("."); 
     116      dirp = opendir ("."); 
    92117    } 
    93118  } 
     
    95120  if (dirp == NULL) 
    96121  { 
    97 #ifdef USE_IMAP 
    98     /* If we are trying to complete an IMAP folder, it will start with { 
    99      * in which case, we just return 0 at this point.  Eventually, we 
    100      * might complete the actually folder name from the server 
    101      */ 
    102     if ((s[0] == '{') || (exp_dirpart[0] == '{')) 
    103       return 0; 
    104 #endif 
    105122    dprint (1, (debugfile, "mutt_complete(): %s: %s (errno %d).\n", exp_dirpart, strerror (errno), errno)); 
    106123    return (-1);