/*
* represent messages to the citadel clients
*
- * Copyright (c) 1987-2012 by the citadel.org team
+ * Copyright (c) 1987-2015 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.
* GNU General Public License for more details.
*/
-#include "sysdep.h"
-#include <stdlib.h>
-#include <unistd.h>
#include <stdio.h>
-#include <fcntl.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 <ctype.h>
-#include <string.h>
-#include <limits.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <regex.h>
-
-#include "md5.h"
-
#include <libcitadel.h>
-#include "citadel.h"
-#include "server.h"
-#include "serv_extensions.h"
-#include "database.h"
-///#include "msgbase.h"
-#include "support.h"
-#include "sysdep_decls.h"
+
#include "citserver.h"
-#include "room_ops.h"
+#include "ctdl_module.h"
+#include "internet_addressing.h"
#include "user_ops.h"
-#include "file_ops.h"
+#include "room_ops.h"
#include "config.h"
-#include "control.h"
-#include "genstamp.h"
-#include "internet_addressing.h"
-#include "euidindex.h"
-#include "journaling.h"
-#include "citadel_dirs.h"
-#include "clientsocket.h"
-#include "threads.h"
-
-#include "ctdl_module.h"
extern char *msgkeys[];
-
/*
* Back end for the MSGS command: output message number only.
*/
}
-
/*
* Back end for the MSGS command: output header summary.
*/
{
struct CtdlMessage *msg;
- msg = CtdlFetchMessage(msgnum, 0);
+ msg = CtdlFetchMessage(msgnum, 0, 1);
if (msg == NULL) {
cprintf("%ld|0|||||\n", msgnum);
return;
{
struct CtdlMessage *msg;
- msg = CtdlFetchMessage(msgnum, 0);
+ msg = CtdlFetchMessage(msgnum, 0, 1);
if (msg == NULL) {
cprintf("%ld||\n", msgnum);
return;
else
mode = MSGS_ALL;
- if ( (mode == MSGS_SEARCH) && (!config.c_enable_fulltext) ) {
+ if ( (mode == MSGS_SEARCH) && (!CtdlGetConfigInt("c_enable_fulltext")) ) {
cprintf("%d Full text index is not enabled on this server.\n",
ERROR + CMD_NOT_SUPPORTED);
return;
msgid = extract_long(cmdbuf, 0);
headers_only = extract_int(cmdbuf, 1);
- CtdlOutputMsg(msgid, MT_CITADEL, headers_only, 1, 0, NULL, 0, NULL, NULL);
+ CtdlOutputMsg(msgid, MT_CITADEL, headers_only, 1, 0, NULL, 0, NULL, NULL, NULL);
return;
}
msgid = extract_long(cmdbuf, 0);
headers_only = extract_int(cmdbuf, 1);
- CtdlOutputMsg(msgid, MT_RFC822, headers_only, 1, 1, NULL, 0, NULL, NULL);
+ CtdlOutputMsg(msgid, MT_RFC822, headers_only, 1, 1, NULL, 0, NULL, NULL, NULL);
}
}
msgnum = extract_long(cmdbuf, 0);
- msg = CtdlFetchMessage(msgnum, 1);
+ msg = CtdlFetchMessage(msgnum, 1, 1);
if (msg == NULL) {
cprintf("%d Message %ld not found.\n",
ERROR + MESSAGE_NOT_FOUND, msgnum);
msgid = extract_long(cmdbuf, 0);
extract_token(section, cmdbuf, 1, '|', sizeof section);
- CtdlOutputMsg(msgid, MT_MIME, 0, 1, 0, (section[0] ? section : NULL) , 0, NULL, NULL);
+ CtdlOutputMsg(msgid, MT_MIME, 0, 1, 0, (section[0] ? section : NULL) , 0, NULL, NULL, NULL);
}
extract_token(desired_section, cmdbuf, 1, '|', sizeof desired_section);
safestrncpy(CC->download_desired_section, desired_section,
sizeof CC->download_desired_section);
- CtdlOutputMsg(msgid, MT_DOWNLOAD, 0, 1, 1, NULL, 0, NULL, NULL);
+ CtdlOutputMsg(msgid, MT_DOWNLOAD, 0, 1, 1, NULL, 0, NULL, NULL, NULL);
}
extract_token(desired_section, cmdbuf, 1, '|', sizeof desired_section);
safestrncpy(CC->download_desired_section, desired_section,
sizeof CC->download_desired_section);
- CtdlOutputMsg(msgid, MT_SPEW_SECTION, 0, 1, 1, NULL, 0, NULL, NULL);
+ CtdlOutputMsg(msgid, MT_SPEW_SECTION, 0, 1, 1, NULL, 0, NULL, NULL, NULL);
}
/*
int anonymous = 0;
char errmsg[SIZ];
int err = 0;
- struct recptypes *valid = NULL;
- struct recptypes *valid_to = NULL;
- struct recptypes *valid_cc = NULL;
- struct recptypes *valid_bcc = NULL;
+ recptypes *valid = NULL;
+ recptypes *valid_to = NULL;
+ recptypes *valid_cc = NULL;
+ recptypes *valid_bcc = NULL;
char subject[SIZ];
int subject_required = 0;
int do_confirm = 0;
switch(CC->room.QRdefaultview) {
case VIEW_NOTES:
case VIEW_WIKI:
+ case VIEW_WIKIMD:
extract_token(supplied_euid, entargs, 9, '|', sizeof supplied_euid);
break;
default:
}
free(all_recps);
- if ((valid != NULL) && (valid->num_room == 1))
+ if ((valid != NULL) && (valid->num_room == 1) && !IsEmptyStr(valid->recp_orgroom))
{
/* posting into an ML room? set the envelope from
* to the actual mail address so others get a valid
* reply-to-header.
*/
- msg->cm_fields[eenVelopeTo] = strdup(valid->recp_orgroom);
+ CM_SetField(msg, eenVelopeTo, valid->recp_orgroom, strlen(valid->recp_orgroom));
}
if (msg != NULL) {