]> code.citadel.org Git - citadel.git/blobdiff - citadel/server/modules/imap/imap_fetch.c
serv_imap: removed all the CCC and CCCIMAP shorthand
[citadel.git] / citadel / server / modules / imap / imap_fetch.c
index 0434879193d0b3aab44c8ae7b18038d1206a74ef..7d2fe746f4e9a39f95b7f66e03ff549ae82a83c3 100644 (file)
@@ -117,8 +117,7 @@ void imap_fetch_internaldate(struct CtdlMessage *msg) {
  *     "RFC822.TEXT"   body only (without leading blank line)
  */
 void imap_fetch_rfc822(long msgnum, const char *whichfmt) {
-       CitContext *CCC = CC;
-       citimap *Imap = CCCIMAP;
+       citimap *Imap = IMAP;
        const char *ptr = NULL;
        size_t headers_size, text_size, total_size;
        size_t bytes_to_send = 0;
@@ -171,7 +170,7 @@ void imap_fetch_rfc822(long msgnum, const char *whichfmt) {
                /*
                 * Load the message into memory for translation & measurement
                 */
-               CCC->redirect_buffer = NewStrBufPlain(NULL, SIZ);
+               CC->redirect_buffer = NewStrBufPlain(NULL, SIZ);
                CtdlOutputMsg(msgnum, MT_RFC822,
                        (need_body ? HEADERS_ALL : HEADERS_FAST),
                        0, 1, NULL, SUPPRESS_ENV_TO, NULL, NULL, NULL
@@ -179,8 +178,8 @@ void imap_fetch_rfc822(long msgnum, const char *whichfmt) {
                if (!need_body) {
                        client_write(HKEY("\r\n"));             // extra trailing newline -- to the redirect_buffer, *not* to the client
                }
-               Imap->cached_rfc822 = CCC->redirect_buffer;
-               CCC->redirect_buffer = NULL;
+               Imap->cached_rfc822 = CC->redirect_buffer;
+               CC->redirect_buffer = NULL;
                Imap->cached_rfc822_msgnum = msgnum;
                Imap->cached_rfc822_withbody = need_body;
                if ( (need_to_rewrite_metadata) && 
@@ -536,9 +535,8 @@ void imap_strip_headers(StrBuf *section) {
        int ok = 0;
        int done_headers = 0;
        const char *Ptr = NULL;
-       CitContext *CCC = CC;
 
-       if (CCC->redirect_buffer == NULL) return;
+       if (CC->redirect_buffer == NULL) return;
 
        which_fields = NewStrBufDup(section);
 
@@ -562,12 +560,12 @@ void imap_strip_headers(StrBuf *section) {
        Cmd.CmdBuf = which_fields;
        num_parms = imap_parameterize(&Cmd);
 
-       boiled_headers = NewStrBufPlain(NULL, StrLength(CCC->redirect_buffer));
+       boiled_headers = NewStrBufPlain(NULL, StrLength(CC->redirect_buffer));
        Line = NewStrBufPlain(NULL, SIZ);
        Ptr = NULL;
        ok = 0;
        do {
-               StrBufSipLine(Line, CCC->redirect_buffer, &Ptr);
+               StrBufSipLine(Line, CC->redirect_buffer, &Ptr);
 
                if (!isspace(ChrPtr(Line)[0])) {
 
@@ -608,8 +606,8 @@ void imap_strip_headers(StrBuf *section) {
        StrBufAppendBufPlain(boiled_headers, HKEY("\r\n"), 0);
 
        /* Now save it back (it'll always be smaller) */
-       FreeStrBuf(&CCC->redirect_buffer);
-       CCC->redirect_buffer = boiled_headers;
+       FreeStrBuf(&CC->redirect_buffer);
+       CC->redirect_buffer = boiled_headers;
 
        free(Cmd.Params);
        FreeStrBuf(&which_fields);
@@ -629,8 +627,7 @@ void imap_fetch_body(long msgnum, ConstStr item, int is_peek) {
        int loading_body_now = 0;
        int need_body = 1;
        int burn_the_cache = 0;
-       CitContext *CCC = CC;
-       citimap *Imap = CCCIMAP;
+       citimap *Imap = IMAP;
 
        /* extract section */
        section = NewStrBufPlain(CKEY(item));
@@ -674,7 +671,7 @@ void imap_fetch_body(long msgnum, ConstStr item, int is_peek) {
        }
 
        if (Imap->cached_body == NULL) {
-               CCC->redirect_buffer = NewStrBufPlain(NULL, SIZ);
+               CC->redirect_buffer = NewStrBufPlain(NULL, SIZ);
                loading_body_now = 1;
                msg = CtdlFetchMessage(msgnum, (need_body ? 1 : 0));
        }
@@ -726,8 +723,8 @@ void imap_fetch_body(long msgnum, ConstStr item, int is_peek) {
        }
 
        if (loading_body_now) {
-               Imap->cached_body_len = StrLength(CCC->redirect_buffer);
-               Imap->cached_body = SmashStrBuf(&CCC->redirect_buffer);
+               Imap->cached_body_len = StrLength(CC->redirect_buffer);
+               Imap->cached_body = SmashStrBuf(&CC->redirect_buffer);
                Imap->cached_bodymsgnum = msgnum;
                Imap->cached_body_withbody = need_body;
                strcpy(Imap->cached_bodypart, ChrPtr(section));