]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/imap/imap_fetch.c
war on BSD style curly braces
[citadel.git] / citadel / modules / imap / imap_fetch.c
index 91cb398323268b149f82a3ead81abb0026adf31e..c9d9c0d6bd23b7d9949bc6a56be0a7660970e391 100644 (file)
@@ -2,7 +2,7 @@
  * Implements the FETCH command in IMAP.
  * This is a good example of the protocol's gratuitous complexity.
  *
- * Copyright (c) 2001-2017 by the citadel.org team
+ * Copyright (c) 2001-2020 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -347,19 +347,14 @@ void imap_output_envelope_from(struct CtdlMessage *msg) {
 
        if (!CM_IsEmpty(msg, erFc822Addr)) {
                process_rfc822_addr(msg->cm_fields[erFc822Addr], user, node, name);
-               IPutStr(user, strlen(user));            /* mailbox name (user id) */
+               IPutStr(user, strlen(user));                    /* mailbox name (user id) */
                IAPuts(" ");
-               if (!strcasecmp(node, CtdlGetConfigStr("c_nodename"))) {
-                       IPutStr(CtdlGetConfigStr("c_fqdn"), strlen(CtdlGetConfigStr("c_fqdn")));
-               }
-               else {
-                       IPutStr(node, strlen(node));            /* host name */
-               }
+               IPutStr(node, strlen(node));                    /* host name */
        }
        else {
-               IPutMsgField(eAuthor); /* mailbox name (user id) */
+               IPutMsgField(eAuthor);                          /* Make up a synthetic address */
                IAPuts(" ");
-               IPutMsgField(eNodeName);        /* host name */
+               IPutStr(CtdlGetConfigStr("c_fqdn"), strlen(CtdlGetConfigStr("c_fqdn")));
        }
        
        IAPuts(")) "); /* close double-parens */
@@ -692,7 +687,7 @@ void imap_fetch_body(long msgnum, ConstStr item, int is_peek) {
        if (Imap->cached_body == NULL) {
                CCC->redirect_buffer = NewStrBufPlain(NULL, SIZ);
                loading_body_now = 1;
-               msg = CtdlFetchMessage(msgnum, (need_body ? 1 : 0), 1);
+               msg = CtdlFetchMessage(msgnum, (need_body ? 1 : 0));
        }
 
        /* Now figure out what the client wants, and get it */
@@ -1067,7 +1062,7 @@ void imap_do_fetch_msg(int seq, citimap_command *Cmd) {
                                msg = NULL;
                        }
                        if (msg == NULL) {
-                               msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+                               msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
                                body_loaded = 1;
                        }
                        imap_fetch_bodystructure(Imap->msgids[seq-1],
@@ -1075,14 +1070,14 @@ void imap_do_fetch_msg(int seq, citimap_command *Cmd) {
                }
                else if (!strcasecmp(Cmd->Params[i].Key, "ENVELOPE")) {
                        if (msg == NULL) {
-                               msg = CtdlFetchMessage(Imap->msgids[seq-1], 0, 1);
+                               msg = CtdlFetchMessage(Imap->msgids[seq-1], 0);
                                body_loaded = 0;
                        }
                        imap_fetch_envelope(msg);
                }
                else if (!strcasecmp(Cmd->Params[i].Key, "INTERNALDATE")) {
                        if (msg == NULL) {
-                               msg = CtdlFetchMessage(Imap->msgids[seq-1], 0, 1);
+                               msg = CtdlFetchMessage(Imap->msgids[seq-1], 0);
                                body_loaded = 0;
                        }
                        imap_fetch_internaldate(msg);