remove typedef from struct recptypes
[citadel.git] / citadel / modules / notes / serv_notes.c
index a250c8ccd63a652d7a317d1f33ad99ee7256a1c5..4ae8ac077a90a2863e899c42edd2eda8771131d6 100644 (file)
@@ -3,19 +3,13 @@
  *
  * Copyright (c) 2007-2012 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 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.
- *
- *  
- *  
- *  
+ * 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.
  */
 
 #include "sysdep.h"
 #include <pwd.h>
 #include <errno.h>
 #include <sys/types.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-
+#include <time.h>
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
@@ -51,7 +34,6 @@
 #include "user_ops.h"
 #include "database.h"
 #include "msgbase.h"
-
 #include "ctdl_module.h"
 
 
@@ -80,7 +62,7 @@ void notes_extract_vnote(char *name, char *filename, char *partnum, char *disp,
  * and modern vNote format notes) and does its best to learn the subject (summary)
  * and EUID (uid) of the note for Citadel's own nefarious purposes.
  */
-int serv_notes_beforesave(struct CtdlMessage *msg, recptypes *recp)
+int serv_notes_beforesave(struct CtdlMessage *msg, struct recptypes *recp)
 {
        char *p;
        int a, i;
@@ -130,12 +112,11 @@ int serv_notes_beforesave(struct CtdlMessage *msg, recptypes *recp)
 
        /* Modern clients are using vNote format.  Check for one... */
 
-       mime_parser(msg->cm_fields[eMesageText],
-               NULL,
-               *notes_extract_vnote,
-               NULL, NULL,
-               &v,             /* user data ptr - put the vnote here */
-               0
+       mime_parser(CM_RANGE(msg, eMesageText),
+                   *notes_extract_vnote,
+                   NULL, NULL,
+                   &v,         /* user data ptr - put the vnote here */
+                   0
        );
 
        if (v == NULL) return(0);       /* no vNotes were found in this message */