X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fnotes%2Fserv_notes.c;h=4ae8ac077a90a2863e899c42edd2eda8771131d6;hb=882ff5a53c3b4e440520a073cf07dc60b2671876;hp=9c1c944d9f881f542f79179b046a02333c18a032;hpb=848934c1722edc208c4df49c571586b72c3fc486;p=citadel.git diff --git a/citadel/modules/notes/serv_notes.c b/citadel/modules/notes/serv_notes.c index 9c1c944d9..4ae8ac077 100644 --- a/citadel/modules/notes/serv_notes.c +++ b/citadel/modules/notes/serv_notes.c @@ -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" @@ -27,18 +21,7 @@ #include #include #include - -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - +#include #include #include #include @@ -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) +int serv_notes_beforesave(struct CtdlMessage *msg, struct recptypes *recp) { char *p; int a, i; @@ -107,7 +89,7 @@ int serv_notes_beforesave(struct CtdlMessage *msg) */ strcpy(uuid, ""); p = msg->cm_fields[eMesageText]; - a = strlen(p); + a = msg->cm_lengths[eMesageText]; while (--a > 0) { if (!strncasecmp(p, "X-KOrg-Note-Id: ", 16)) { /* Found it */ safestrncpy(uuid, p + 16, sizeof(uuid)); @@ -130,12 +112,11 @@ int serv_notes_beforesave(struct CtdlMessage *msg) /* 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 */ @@ -152,7 +133,7 @@ int serv_notes_beforesave(struct CtdlMessage *msg) if ((v->summary) && (!IsEmptyStr(v->summary))) { CM_SetField(msg, eMsgSubject, v->summary, strlen(v->summary)); - if (strlen(msg->cm_fields[eMsgSubject]) > 72) { + if (msg->cm_lengths[eMsgSubject] > 72) { strcpy(&msg->cm_fields[eMsgSubject][68], "..."); CM_CutFieldAt(msg, eMsgSubject, 72); }