]> code.citadel.org Git - citadel.git/blobdiff - citadel/server/modules/imap/imap_search.c
validate_recipients() remove extra copy of recipients
[citadel.git] / citadel / server / modules / imap / imap_search.c
index 1c70de8abdaa8b129c23bcc28af6b38dbe72bae0..1ea13ad3e024243fc1dae7b4da369ee68bff4eff 100644 (file)
@@ -1,16 +1,8 @@
-/*
- * Implements IMAP's gratuitously complex SEARCH command.
- *
- * 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 version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
+// Implements IMAP's gratuitously complex SEARCH command.
+//
+// Copyright (c) 2001-2024 by the citadel.org team
+//
+// This program is open source software.  Use, duplication, or disclosure is subject to the GNU General Public License v3.
 
 #include "../../ctdl_module.h"
 #include "../../sysdep.h"
  * message after it has been fetched from the disk.  This function returns
  * nonzero if there is a match.
  *
- * supplied_msg MAY be used to pass a pointer to the message in memory,
+ * msg_in MAY be used to pass a pointer to the message in memory,
  * if for some reason it's already been loaded.  If not, the message will
  * be loaded only if one or more search criteria require it.
  */
-int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg,
+int imap_do_search_msg(int seq, struct CtdlMessage *msg_in,
                        int num_items, ConstStr *itemlist, int is_uid) {
 
        citimap *Imap = IMAP;
@@ -71,7 +63,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg,
        if (num_items == 0) {
                return(0);
        }
-       msg = supplied_msg;
+       msg = msg_in;
 
        /* Initially we start at the beginning. */
        pos = 0;
@@ -107,7 +99,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg,
                        need_to_free_msg = 1;
                }
                if (msg != NULL) {
-                       fieldptr = rfc822_fetch_field(msg->cm_fields[eMesageText], "Bcc");
+                       fieldptr = rfc822_fetch_field(msg->cm_fields[eMessageText], "Bcc");
                        if (fieldptr != NULL) {
                                if (bmstrcasestr(fieldptr, itemlist[pos+1].Key)) {
                                        match = 1;
@@ -150,7 +142,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg,
                                need_to_free_msg = 1;
                        }
                        if (msg != NULL) {
-                               if (bmstrcasestr(msg->cm_fields[eMesageText], itemlist[pos+1].Key)) {
+                               if (bmstrcasestr(msg->cm_fields[eMessageText], itemlist[pos+1].Key)) {
                                        match = 1;
                                }
                        }
@@ -172,7 +164,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg,
                                }
                        }
                        else {
-                               fieldptr = rfc822_fetch_field(msg->cm_fields[eMesageText], "Cc");
+                               fieldptr = rfc822_fetch_field(msg->cm_fields[eMessageText], "Cc");
                                if (fieldptr != NULL) {
                                        if (bmstrcasestr(fieldptr, itemlist[pos+1].Key)) {
                                                match = 1;
@@ -263,7 +255,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg,
                        need_to_free_msg = 1;
                }
                if (msg != NULL) {
-                       if (msg->cm_lengths[eMesageText] > atoi(itemlist[pos+1].Key)) {
+                       if (msg->cm_lengths[eMessageText] > atoi(itemlist[pos+1].Key)) {
                                match = 1;
                        }
                }
@@ -384,7 +376,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg,
                        need_to_free_msg = 1;
                }
                if (msg != NULL) {
-                       if (msg->cm_lengths[eMesageText] < atoi(itemlist[pos+1].Key)) {
+                       if (msg->cm_lengths[eMessageText] < atoi(itemlist[pos+1].Key)) {
                                match = 1;
                        }
                }