dammit, learn to spell
[citadel.git] / citadel / server / modules / notes / serv_notes.c
index 1351db3da369ac22502f948f31f60dc39b5bd486..dfa3e597e8d9419d1d03f49c33fa4d5a0c9a9dd9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Handles functions related to yellow sticky notes.
  *
- * Copyright (c) 2007-2022 by the citadel.org team
+ * Copyright (c) 2007-2023 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.
@@ -26,7 +26,7 @@
 #include <string.h>
 #include <limits.h>
 #include <libcitadel.h>
-#include "../../citadel.h"
+#include "../../citadel_defs.h"
 #include "../../server.h"
 #include "../../citserver.h"
 #include "../../support.h"
@@ -88,8 +88,8 @@ int serv_notes_beforesave(struct CtdlMessage *msg, struct recptypes *recp)
         * any existing message containing that UUID.
         */
        strcpy(uuid, "");
-       p = msg->cm_fields[eMesageText];
-       a = msg->cm_lengths[eMesageText];
+       p = msg->cm_fields[eMessageText];
+       a = msg->cm_lengths[eMessageText];
        while (--a > 0) {
                if (!strncasecmp(p, "X-KOrg-Note-Id: ", 16)) {  /* Found it */
                        safestrncpy(uuid, p + 16, sizeof(uuid));
@@ -102,7 +102,7 @@ int serv_notes_beforesave(struct CtdlMessage *msg, struct recptypes *recp)
 
                        syslog(LOG_DEBUG, "UUID of note is: %s\n", uuid);
                        if (!IsEmptyStr(uuid)) {
-                               CM_SetField(msg, eExclusiveID, uuid, strlen(uuid));
+                               CM_SetField(msg, eExclusiveID, uuid);
 
                                CM_CopyField(msg, eMsgSubject, eExclusiveID);
                        }
@@ -112,7 +112,7 @@ int serv_notes_beforesave(struct CtdlMessage *msg, struct recptypes *recp)
 
        /* Modern clients are using vNote format.  Check for one... */
 
-       mime_parser(CM_RANGE(msg, eMesageText),
+       mime_parser(CM_RANGE(msg, eMessageText),
                    *notes_extract_vnote,
                    NULL, NULL,
                    &v,         /* user data ptr - put the vnote here */
@@ -125,13 +125,13 @@ int serv_notes_beforesave(struct CtdlMessage *msg, struct recptypes *recp)
 
        if ((v->uid) && (!IsEmptyStr(v->uid))) {
                syslog(LOG_DEBUG, "UID of vNote is: %s\n", v->uid);
-               CM_SetField(msg, eExclusiveID, v->uid, strlen(v->uid));
+               CM_SetField(msg, eExclusiveID, v->uid);
        }
 
        /* Set the message Subject to the vNote Summary */
 
        if ((v->summary) && (!IsEmptyStr(v->summary))) {
-               CM_SetField(msg, eMsgSubject, v->summary, strlen(v->summary));
+               CM_SetField(msg, eMsgSubject, v->summary);
 
                if (msg->cm_lengths[eMsgSubject] > 72) {
                        strcpy(&msg->cm_fields[eMsgSubject][68], "...");