conf = NULL;
}
else {
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg != NULL) {
conf = strdup(msg->cm_fields[eMesageText]);
CM_Free(msg);
/*
* Index messages by EUID per room.
*
- * Copyright (c) 1987-2019 by the citadel.org team
+ * Copyright (c) 1987-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.
void rebuild_euid_index_for_msg(long msgnum, void *userdata) {
struct CtdlMessage *msg = NULL;
- msg = CtdlFetchMessage(msgnum, 0, 1);
+ msg = CtdlFetchMessage(msgnum, 0);
if (msg == NULL) return;
if (!CM_IsEmpty(msg, eExclusiveID)) {
index_message_by_euid(msg->cm_fields[eExclusiveID], &CC->room, msgnum);
/*
* Autocompletion of email recipients, etc.
*
- * Copyright (c) 1987-2015 by the citadel.org team
+ * Copyright (c) 1987-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.
int i = 0;
char *nnn = NULL;
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) return;
v = vcard_load(msg->cm_fields[eMesageText]);
* This module implementsserver commands related to the display and
* manipulation of user "bio" files.
*
- * Copyright (c) 1987-2017 by the citadel.org team
+ * Copyright (c) 1987-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 as published by
ruser.fullname, ruser.usernum, ruser.axlevel,
(long)ruser.lastcall, ruser.timescalled, ruser.posted);
- struct CtdlMessage *msg = CtdlFetchMessage(ruser.msgnum_bio, 1, 1);
+ struct CtdlMessage *msg = CtdlFetchMessage(ruser.msgnum_bio, 1);
if (msg != NULL) {
CtdlOutputPreLoadedMsg(msg, MT_CITADEL, HEADERS_NONE, 0, 0, 0);
CM_Free(msg);
return;
}
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) {
cprintf("%d Message %ld not found.\n",
ERROR + ILLEGAL_VALUE,
* us the ability to load the event into memory so we can diddle the
* attendees.
*/
- msg = CtdlFetchMessage(msgnum_being_replaced, 1, 1);
+ msg = CtdlFetchMessage(msgnum_being_replaced, 1);
if (msg == NULL) {
return(2); /* internal error */
}
return;
}
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) {
cprintf("%d Message %ld not found.\n",
ERROR + ILLEGAL_VALUE,
proposed_event = (icalcomponent *)data;
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) return;
memset(&ird, 0, sizeof ird);
strcpy(ird.desired_partnum, "_HUNT_");
struct CtdlMessage *msg = NULL;
struct ical_respond_data ird;
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) {
cprintf("%d Message %ld not found\n",
ERROR + ILLEGAL_VALUE,
fb = (icalcomponent *)data; /* User-supplied data will be the VFREEBUSY component */
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) return;
memset(&ird, 0, sizeof ird);
strcpy(ird.desired_partnum, "_HUNT_");
/* Look for the calendar event... */
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) return;
memset(&ird, 0, sizeof ird);
strcpy(ird.desired_partnum, "_HUNT_");
/*
* represent messages to the citadel clients
*
- * Copyright (c) 1987-2019 by the citadel.org team
+ * Copyright (c) 1987-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.
struct CtdlMessage *msg;
int output_mode = *(int *)userdata;
- msg = CtdlFetchMessage(msgnum, 0, 1);
+ msg = CtdlFetchMessage(msgnum, 0);
if (msg == NULL) {
cprintf("%ld|0|||||||\n", msgnum);
return;
msg_filter *flt = (msg_filter*) userdata;
l = GetCount(flt->Filter);
- msg = CtdlFetchMessage(msgnum, 0, 1);
+ msg = CtdlFetchMessage(msgnum, 0);
StrBufPrintf(flt->buffer, "%ld", msgnum);
if (msg == NULL) {
for (i = 0; i < l; i++) {
{
struct CtdlMessage *msg;
- msg = CtdlFetchMessage(msgnum, 0, 1);
+ msg = CtdlFetchMessage(msgnum, 0);
if (msg == NULL) {
cprintf("%ld||\n", msgnum);
return;
/*
* Server functions which perform operations on room objects.
*
- * Copyright (c) 1987-2017 by the citadel.org team
+ * Copyright (c) 1987-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.
*/
void cmd_rinf(char *argbuf)
{
- struct CtdlMessage *msg = CtdlFetchMessage(CC->room.msgnum_info, 1, 1);
+ struct CtdlMessage *msg = CtdlFetchMessage(CC->room.msgnum_info, 1);
if (msg != NULL) {
cprintf("%d Info:\n", LISTING_FOLLOWS);
CtdlOutputPreLoadedMsg(msg, MT_CITADEL, HEADERS_NONE, 0, 0, 0);
*
* You might also see this module affectionately referred to as TDAP (The Dreaded Auto-Purger).
*
- * Copyright (c) 1988-2019 by citadel.org (Art Cancro, Wilifried Goesgens, and others)
+ * Copyright (c) 1988-2020 by citadel.org (Art Cancro, Wilifried Goesgens, and others)
*
* This program is open source software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
for (a=0; a<num_msgs; ++a) {
delnum = msglist[a];
- msg = CtdlFetchMessage(delnum, 0, 1); /* dont need body */
+ msg = CtdlFetchMessage(delnum, 0); /* don't need body */
if (msg != NULL) {
xtime = atol(msg->cm_fields[eTimestamp]);
CM_Free(msg);
memcpy(&msgnum, cdbei->ptr, sizeof(long));
- msg = CtdlFetchMessage(msgnum, 0, 1);
+ msg = CtdlFetchMessage(msgnum, 0);
if (msg != NULL) {
CM_Free(msg); /* it still exists, so do nothing */
}
/*
* This module handles fulltext indexing of the message base.
- * Copyright (c) 2005-2018 by the citadel.org team
+ * Copyright (c) 2005-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 as published
int tok;
struct CtdlMessage *msg = NULL;
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) {
syslog(LOG_ERR, "fulltext: ft_index_message() could not load msg %ld", msgnum);
return;
/*
- * Copyright (c) 1987-2018 by the citadel.org team
+ * Copyright (c) 1987-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 as published by
return;
}
- struct CtdlMessage *msg = CtdlFetchMessage(CC->room.msgnum_pic, 1, 1);
+ struct CtdlMessage *msg = CtdlFetchMessage(CC->room.msgnum_pic, 1);
if (msg != NULL) {
// The call to CtdlOutputPreLoadedMsg() with MT_SPEW_SECTION will cause the DLRI command
// to have the same output format as the DLAT command, because it calls the same code.
return;
}
- struct CtdlMessage *msg = CtdlFetchMessage(ruser.msgnum_pic, 1, 1);
+ struct CtdlMessage *msg = CtdlFetchMessage(ruser.msgnum_pic, 1);
if (msg != NULL) {
// The call to CtdlOutputPreLoadedMsg() with MT_SPEW_SECTION will cause the DLUI command
// to have the same output format as the DLAT command, because it calls the same code.
if (Imap->cached_body == NULL) {
CCC->redirect_buffer = NewStrBufPlain(NULL, SIZ);
loading_body_now = 1;
- msg = CtdlFetchMessage(msgnum, (need_body ? 1 : 0), 1);
+ msg = CtdlFetchMessage(msgnum, (need_body ? 1 : 0));
}
/* Now figure out what the client wants, and get it */
msg = NULL;
}
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
body_loaded = 1;
}
imap_fetch_bodystructure(Imap->msgids[seq-1],
}
else if (!strcasecmp(Cmd->Params[i].Key, "ENVELOPE")) {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 0, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 0);
body_loaded = 0;
}
imap_fetch_envelope(msg);
}
else if (!strcasecmp(Cmd->Params[i].Key, "INTERNALDATE")) {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 0, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 0);
body_loaded = 0;
}
imap_fetch_internaldate(msg);
/*
* Implements IMAP's gratuitously complex SEARCH command.
*
- * Copyright (c) 2001-2015 by the citadel.org team
+ * 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.
else if (!strcasecmp(itemlist[pos].Key, "BCC")) {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
need_to_free_msg = 1;
}
if (msg != NULL) {
else if (!strcasecmp(itemlist[pos].Key, "BEFORE")) {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
need_to_free_msg = 1;
}
if (msg != NULL) {
/* Otherwise, we have to do a slow search. */
else {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
need_to_free_msg = 1;
}
if (msg != NULL) {
else if (!strcasecmp(itemlist[pos].Key, "CC")) {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
need_to_free_msg = 1;
}
if (msg != NULL) {
else if (!strcasecmp(itemlist[pos].Key, "FROM")) {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
need_to_free_msg = 1;
}
if (msg != NULL) {
* examining the message body.
*/
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
need_to_free_msg = 1;
}
else if (!strcasecmp(itemlist[pos].Key, "LARGER")) {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
need_to_free_msg = 1;
}
if (msg != NULL) {
else if (!strcasecmp(itemlist[pos].Key, "ON")) {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
need_to_free_msg = 1;
}
if (msg != NULL) {
else if (!strcasecmp(itemlist[pos].Key, "SENTBEFORE")) {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
need_to_free_msg = 1;
}
if (msg != NULL) {
else if (!strcasecmp(itemlist[pos].Key, "SENTON")) {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
need_to_free_msg = 1;
}
if (msg != NULL) {
else if (!strcasecmp(itemlist[pos].Key, "SENTSINCE")) {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
need_to_free_msg = 1;
}
if (msg != NULL) {
else if (!strcasecmp(itemlist[pos].Key, "SINCE")) {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
need_to_free_msg = 1;
}
if (msg != NULL) {
else if (!strcasecmp(itemlist[pos].Key, "SMALLER")) {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
need_to_free_msg = 1;
}
if (msg != NULL) {
else if (!strcasecmp(itemlist[pos].Key, "SUBJECT")) {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
need_to_free_msg = 1;
}
if (msg != NULL) {
else if (!strcasecmp(itemlist[pos].Key, "TEXT")) {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
need_to_free_msg = 1;
}
if (msg != NULL) {
else if (!strcasecmp(itemlist[pos].Key, "TO")) {
if (msg == NULL) {
- msg = CtdlFetchMessage(Imap->msgids[seq-1], 1, 1);
+ msg = CtdlFetchMessage(Imap->msgids[seq-1], 1);
need_to_free_msg = 1;
}
if (msg != NULL) {
return SIEVE2_ERROR_BADARGS;
}
- msg = CtdlFetchMessage(cs->msgnum, 1, 1);
+ msg = CtdlFetchMessage(cs->msgnum, 1);
if (msg == NULL) {
syslog(LOG_WARNING, "REDIRECT failed: unable to fetch msg %ld", cs->msgnum);
free_recipients(valid);
/*
* Perform sieve processing for one message (called by sieve_do_room() for each message)
*/
-void sieve_do_msg(long msgnum, void *userdata) {
+void inbox_do_msg(long msgnum, void *userdata) {
struct sdm_userdata *u = (struct sdm_userdata *) userdata;
sieve2_context_t *sieve2_context;
struct ctdl_sieve my;
/*
* Make sure you include message body so you can get those second-level headers ;)
*/
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) return;
/*
/*
- * rename this
+ * Process a single message. We know the room, the user, the rules, the message number, etc.
*/
-void sieve_do_msg(long msgnum, void *userdata) {
- struct inboxrules *ii = (struct sdm_userdata *) userdata;
+void inbox_do_msg(long msgnum, void *userdata) {
+ struct inboxrules *ii = (struct inboxrules *) userdata;
+ struct CtdlMessage *msg;
syslog(LOG_DEBUG, "inboxrules: processing message #%ld which is higher than %ld, we are in %s", msgnum, ii->lastproc, CC->room.QRname);
-}
+
+ // FIXME you are here
+ //msg = CtdlFetchMessage(msgnum,
+
+}
/*
return; // this user has no inbox rules
}
- msg = CtdlFetchMessage(CC->user.msgnum_inboxrules, 1, 1);
+ msg = CtdlFetchMessage(CC->user.msgnum_inboxrules, 1);
if (msg == NULL) {
return; // config msgnum is set but that message does not exist
}
syslog(LOG_DEBUG, "GOT DA ROOM! WE R000000000L!");
/* Do something useful */
- CtdlForEachMessage(MSGS_GT, ii->lastproc, NULL, NULL, NULL, sieve_do_msg, (void *) ii);
+ CtdlForEachMessage(MSGS_GT, ii->lastproc, NULL, NULL, NULL, inbox_do_msg, (void *) ii);
}
/*
* Here is an array of users (by number) who have received messages in their inbox and may require processing.
-*/
+ */
long *users_requiring_inbox_processing = NULL;
int num_urip = 0;
int num_urip_alloc = 0;
cprintf("%d inbox rules for %s\n", LISTING_FOLLOWS, CC->user.fullname);
- struct CtdlMessage *msg = CtdlFetchMessage(CC->user.msgnum_inboxrules, 1, 1);
+ struct CtdlMessage *msg = CtdlFetchMessage(CC->user.msgnum_inboxrules, 1);
if (msg != NULL) {
if (!CM_IsEmpty(msg, eMesageText)) {
char *token;
// Fetch the existing config so we can merge in anything that is NOT a rule
// (Does not start with "rule|" but has at least one vertical bar)
- struct CtdlMessage *msg = CtdlFetchMessage(CC->user.msgnum_inboxrules, 1, 1);
+ struct CtdlMessage *msg = CtdlFetchMessage(CC->user.msgnum_inboxrules, 1);
if (msg != NULL) {
if (!CM_IsEmpty(msg, eMesageText)) {
rest = msg->cm_fields[eMesageText];
* wrote it as a module merely to keep things as clean and loosely coupled
* as possible.
*
- * Copyright (c) 1987-2017 by the citadel.org team
+ * Copyright (c) 1987-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.
void inetcfg_init_backend(long msgnum, void *userdata) {
struct CtdlMessage *msg;
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg != NULL) {
inetcfg_setTo(msg);
CM_Free(msg);
/* Ok, here we go ... */
- msg = CtdlFetchMessage(msgnum, 1, 0);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) return; /* fail silently */
client_write(HKEY("<message>\n"));
/* Ok, here we go ... */
- msg = CtdlFetchMessage(msgnum, 1, 0);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) {
return 1;
}
SpoolControl *sc;
sc = (SpoolControl *)userdata;
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL)
{
* This module handles shared rooms, inter-Citadel mail, and outbound
* mailing list processing.
*
- * Copyright (c) 2000-2018 by the citadel.org team
+ * Copyright (c) 2000-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.
#define MAX_LISTIDLENGTH 150
// Load the room banner as the list description
- struct CtdlMessage *msg = CtdlFetchMessage(sc->room.msgnum_info, 1, 1);
+ struct CtdlMessage *msg = CtdlFetchMessage(sc->room.msgnum_info, 1);
if (msg != NULL) {
CC->redirect_buffer = NewStrBufPlain(NULL, SIZ);
CtdlOutputPreLoadedMsg(msg, MT_CITADEL, HEADERS_NONE, 0, 0, 0);
//
// NNTP server module (RFC 3977)
//
-// Copyright (c) 2014-2018 by the citadel.org team
+// Copyright (c) 2014-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.
if (msgnum < lr->lo) return;
if ((lr->hi != 0) && (msgnum > lr->hi)) return;
- struct CtdlMessage *msg = CtdlFetchMessage(msgnum, 0, 1);
+ struct CtdlMessage *msg = CtdlFetchMessage(msgnum, 0);
if (msg == NULL) {
return;
}
* The VRFY and EXPN commands have been removed from this implementation
* because nobody uses these commands anymore, except for spammers.
*
- * Copyright (c) 1998-2018 by the citadel.org team
+ * Copyright (c) 1998-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.
return; // already got it
}
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) {
return;
}
*
* This is the new, exciting, clever version that makes libcurl do all the work :)
*
- * Copyright (c) 1997-2018 by the citadel.org team
+ * Copyright (c) 1997-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 as published
int delete_this_queue = 0;
char server_response[SIZ];
- msg = CtdlFetchMessage(qmsgnum, 1, 1);
+ msg = CtdlFetchMessage(qmsgnum, 1);
if (msg == NULL) {
syslog(LOG_WARNING, "smtpclient: %ld does not exist", qmsgnum);
return;
* A server-side module for Citadel which supports address book information
* using the standard vCard format.
*
- * Copyright (c) 1999-2018 by the citadel.org team
+ * Copyright (c) 1999-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.
if (VCmsgnum < 0L) return vcard_new();
- msg = CtdlFetchMessage(VCmsgnum, 1, 1);
+ msg = CtdlFetchMessage(VCmsgnum, 1);
if (msg == NULL) return vcard_new();
v = vcard_load(msg->cm_fields[eMesageText]);
void dvca_callback(long msgnum, void *userdata) {
struct CtdlMessage *msg = NULL;
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) return;
mime_parser(CM_RANGE(msg, eMesageText),
*dvca_mime_callback, /* callback function */
collected_addresses = (char *)userdata;
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) return;
v = vcard_load(msg->cm_fields[eMesageText]);
CM_Free(msg);
/*
* Server-side module for Wiki rooms. This handles things like version control.
*
- * Copyright (c) 2009-2018 by the citadel.org team
+ * Copyright (c) 2009-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.
/* See if we can retrieve the previous version. */
old_msgnum = CtdlLocateMessageByEuid(msg->cm_fields[eExclusiveID], &CCC->room);
if (old_msgnum > 0L) {
- old_msg = CtdlFetchMessage(old_msgnum, 1, 1);
+ old_msg = CtdlFetchMessage(old_msgnum, 1);
}
else {
old_msg = NULL;
history_msgnum = CtdlLocateMessageByEuid(history_page, &CCC->room);
history_msg = NULL;
if (history_msgnum > 0L) {
- history_msg = CtdlFetchMessage(history_msgnum, 1, 1);
+ history_msg = CtdlFetchMessage(history_msgnum, 1);
}
/* Create a new history message if necessary */
snprintf(history_page_name, sizeof history_page_name, "%s_HISTORY_", pagename);
msgnum = CtdlLocateMessageByEuid(history_page_name, &CC->room);
if (msgnum > 0L) {
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
}
else {
msg = NULL;
*/
msgnum = CtdlLocateMessageByEuid(pagename, &CCC->room);
if (msgnum > 0L) {
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
}
else {
msg = NULL;
snprintf(history_page_name, sizeof history_page_name, "%s_HISTORY_", pagename);
msgnum = CtdlLocateMessageByEuid(history_page_name, &CCC->room);
if (msgnum > 0L) {
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
}
else {
msg = NULL;
/*
* Handle XMPP presence exchanges
*
- * Copyright (c) 2007-2017 by Art Cancro and citadel.org
+ * Copyright (c) 2007-2020 by Art Cancro and citadel.org
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
char *ptr = NULL;
char *lasts = NULL;
- msg = CtdlFetchMessage(msgnum, 1, 1);
+ msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) {
return;
}
free(msglist);
return -1;
}
- msg = CtdlFetchMessage(msglist[a], 1, 1);
+ msg = CtdlFetchMessage(msglist[a], 1);
if (msg != NULL) {
if (CtdlMsgCmp(msg, compare)) {
msglist[a] = 0L;
* NOTE: Caller is responsible for freeing the returned CtdlMessage struct
* using the CM_Free(); function.
*/
-struct CtdlMessage *CtdlFetchMessage(long msgnum, int with_body, int run_msg_hooks)
+struct CtdlMessage *CtdlFetchMessage(long msgnum, int with_body)
{
struct cdbdata *dmsgtext;
struct CtdlMessage *ret = NULL;
CM_SetField(ret, eMesageText, HKEY("\r\n\r\n (no text)\r\n"));
}
- /* Perform "before read" hooks (aborting if any return nonzero) */
- if (run_msg_hooks && (PerformMessageHooks(ret, NULL, EVT_BEFOREREAD) > 0)) {
- CM_Free(ret);
- return NULL;
- }
-
return (ret);
}
* request that we don't even bother loading the body into memory.
*/
if (headers_only == HEADERS_FAST) {
- TheMessage = CtdlFetchMessage(msg_num, 0, 1);
+ TheMessage = CtdlFetchMessage(msg_num, 0);
}
else {
- TheMessage = CtdlFetchMessage(msg_num, 1, 1);
+ TheMessage = CtdlFetchMessage(msg_num, 1);
}
if (TheMessage == NULL) {
msg = supplied_msg;
}
else {
- msg = CtdlFetchMessage(msgid, 0, 1);
+ msg = CtdlFetchMessage(msgid, 0);
}
if (msg != NULL) {
int is_unique, /* Del others of this type? */
unsigned int flags /* Internal save flags */
);
-struct CtdlMessage *CtdlFetchMessage(long msgnum, int with_body, int run_msg_hooks);
+struct CtdlMessage *CtdlFetchMessage(long msgnum, int with_body);
struct CtdlMessage * CM_Duplicate
(struct CtdlMessage *OrgMsg);
int CM_IsEmpty (struct CtdlMessage *Msg, eMsgField which);
#define EVT_PURGEUSER 100 /* Deleting a user */
#define EVT_NEWUSER 102 /* Creating a user */
-#define EVT_BEFOREREAD 200
#define EVT_BEFORESAVE 201
#define EVT_AFTERSAVE 202
#define EVT_SMTPSCAN 203 /* called before submitting a msg from SMTP */