From 7f9d699a7f73ac27bcbde2075a8758744036fb98 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 9 Aug 2020 16:48:18 -0400 Subject: [PATCH] Removed support for 'before read hooks' because there is no such thing. --- citadel/config.c | 2 +- citadel/euidindex.c | 4 +-- .../autocompletion/serv_autocompletion.c | 4 +-- citadel/modules/bio/serv_bio.c | 4 +-- citadel/modules/calendar/serv_calendar.c | 14 ++++---- citadel/modules/ctdlproto/serv_messages.c | 8 ++--- citadel/modules/ctdlproto/serv_rooms.c | 4 +-- citadel/modules/expire/serv_expire.c | 6 ++-- citadel/modules/fulltext/serv_fulltext.c | 4 +-- citadel/modules/image/serv_image.c | 6 ++-- citadel/modules/imap/imap_fetch.c | 8 ++--- citadel/modules/imap/imap_search.c | 34 +++++++++---------- citadel/modules/inboxrules/serv_inboxrules.c | 29 +++++++++------- citadel/modules/inetcfg/serv_inetcfg.c | 4 +-- citadel/modules/migrate/serv_migrate.c | 4 +-- citadel/modules/network/serv_netmail.c | 2 +- citadel/modules/network/serv_netspool.c | 4 +-- citadel/modules/nntp/serv_nntp.c | 4 +-- citadel/modules/smtp/serv_smtp.c | 4 +-- citadel/modules/smtp/serv_smtpclient.c | 4 +-- citadel/modules/vcard/serv_vcard.c | 8 ++--- citadel/modules/wiki/serv_wiki.c | 12 +++---- citadel/modules/xmpp/xmpp_presence.c | 4 +-- citadel/msgbase.c | 16 +++------ citadel/msgbase.h | 2 +- citadel/server.h | 1 - 26 files changed, 97 insertions(+), 99 deletions(-) diff --git a/citadel/config.c b/citadel/config.c index d5dc85d98..3e9ac8b07 100644 --- a/citadel/config.c +++ b/citadel/config.c @@ -485,7 +485,7 @@ char *CtdlGetSysConfig(char *sysconfname) { conf = NULL; } else { - msg = CtdlFetchMessage(msgnum, 1, 1); + msg = CtdlFetchMessage(msgnum, 1); if (msg != NULL) { conf = strdup(msg->cm_fields[eMesageText]); CM_Free(msg); diff --git a/citadel/euidindex.c b/citadel/euidindex.c index 8533caabf..bfef39b4c 100644 --- a/citadel/euidindex.c +++ b/citadel/euidindex.c @@ -1,7 +1,7 @@ /* * 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. @@ -131,7 +131,7 @@ void index_message_by_euid(char *euid, struct ctdlroom *qrbuf, long msgnum) { 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); diff --git a/citadel/modules/autocompletion/serv_autocompletion.c b/citadel/modules/autocompletion/serv_autocompletion.c index ca7c0ae42..0e39b6435 100644 --- a/citadel/modules/autocompletion/serv_autocompletion.c +++ b/citadel/modules/autocompletion/serv_autocompletion.c @@ -1,7 +1,7 @@ /* * 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. @@ -59,7 +59,7 @@ void hunt_for_autocomplete(long msgnum, char *search_string) { 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]); diff --git a/citadel/modules/bio/serv_bio.c b/citadel/modules/bio/serv_bio.c index c9d94943f..4246f1a3e 100644 --- a/citadel/modules/bio/serv_bio.c +++ b/citadel/modules/bio/serv_bio.c @@ -2,7 +2,7 @@ * 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 @@ -82,7 +82,7 @@ void cmd_rbio(char *cmdbuf) 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); diff --git a/citadel/modules/calendar/serv_calendar.c b/citadel/modules/calendar/serv_calendar.c index c38ffd250..939bb9551 100644 --- a/citadel/modules/calendar/serv_calendar.c +++ b/citadel/modules/calendar/serv_calendar.c @@ -360,7 +360,7 @@ void ical_respond(long msgnum, char *partnum, char *action) { return; } - msg = CtdlFetchMessage(msgnum, 1, 1); + msg = CtdlFetchMessage(msgnum, 1); if (msg == NULL) { cprintf("%d Message %ld not found.\n", ERROR + ILLEGAL_VALUE, @@ -619,7 +619,7 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) { * 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 */ } @@ -699,7 +699,7 @@ void ical_handle_rsvp(long msgnum, char *partnum, char *action) { return; } - msg = CtdlFetchMessage(msgnum, 1, 1); + msg = CtdlFetchMessage(msgnum, 1); if (msg == NULL) { cprintf("%d Message %ld not found.\n", ERROR + ILLEGAL_VALUE, @@ -1134,7 +1134,7 @@ void ical_hunt_for_conflicts_backend(long msgnum, void *data) { 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_"); @@ -1193,7 +1193,7 @@ void ical_conflicts(long msgnum, char *partnum) { 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, @@ -1377,7 +1377,7 @@ void ical_freebusy_backend(long msgnum, void *data) { 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_"); @@ -1574,7 +1574,7 @@ void ical_getics_backend(long msgnum, void *data) { /* 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_"); diff --git a/citadel/modules/ctdlproto/serv_messages.c b/citadel/modules/ctdlproto/serv_messages.c index 49a0cff91..01fe2a893 100644 --- a/citadel/modules/ctdlproto/serv_messages.c +++ b/citadel/modules/ctdlproto/serv_messages.c @@ -1,7 +1,7 @@ /* * 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. @@ -42,7 +42,7 @@ void headers_listing(long msgnum, void *userdata) 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; @@ -109,7 +109,7 @@ void headers_brief_filter(long msgnum, void *userdata) 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++) { @@ -141,7 +141,7 @@ void headers_euid(long msgnum, void *userdata) { struct CtdlMessage *msg; - msg = CtdlFetchMessage(msgnum, 0, 1); + msg = CtdlFetchMessage(msgnum, 0); if (msg == NULL) { cprintf("%ld||\n", msgnum); return; diff --git a/citadel/modules/ctdlproto/serv_rooms.c b/citadel/modules/ctdlproto/serv_rooms.c index d789372a3..ffd3037fb 100644 --- a/citadel/modules/ctdlproto/serv_rooms.c +++ b/citadel/modules/ctdlproto/serv_rooms.c @@ -1,7 +1,7 @@ /* * 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. @@ -716,7 +716,7 @@ void cmd_seta(char *new_ra) */ 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); diff --git a/citadel/modules/expire/serv_expire.c b/citadel/modules/expire/serv_expire.c index 09e9eab10..89c730cdd 100644 --- a/citadel/modules/expire/serv_expire.c +++ b/citadel/modules/expire/serv_expire.c @@ -3,7 +3,7 @@ * * 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 @@ -169,7 +169,7 @@ void GatherPurgeMessages(struct ctdlroom *qrbuf, void *data) { for (a=0; acm_fields[eTimestamp]); CM_Free(msg); @@ -712,7 +712,7 @@ int PurgeEuidIndexTable(void) { 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 */ } diff --git a/citadel/modules/fulltext/serv_fulltext.c b/citadel/modules/fulltext/serv_fulltext.c index 17c755da5..1d684111a 100644 --- a/citadel/modules/fulltext/serv_fulltext.c +++ b/citadel/modules/fulltext/serv_fulltext.c @@ -1,6 +1,6 @@ /* * 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 @@ -121,7 +121,7 @@ void ft_index_message(long msgnum, int op) { 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; diff --git a/citadel/modules/image/serv_image.c b/citadel/modules/image/serv_image.c index cec720677..0751010d5 100644 --- a/citadel/modules/image/serv_image.c +++ b/citadel/modules/image/serv_image.c @@ -1,5 +1,5 @@ /* - * 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 @@ -31,7 +31,7 @@ void cmd_dlri(char *cmdbuf) 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. @@ -123,7 +123,7 @@ void cmd_dlui(char *cmdbuf) 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. diff --git a/citadel/modules/imap/imap_fetch.c b/citadel/modules/imap/imap_fetch.c index 293fecca0..c9d9c0d6b 100644 --- a/citadel/modules/imap/imap_fetch.c +++ b/citadel/modules/imap/imap_fetch.c @@ -687,7 +687,7 @@ void imap_fetch_body(long msgnum, ConstStr item, int is_peek) { 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 */ @@ -1062,7 +1062,7 @@ void imap_do_fetch_msg(int seq, citimap_command *Cmd) { 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], @@ -1070,14 +1070,14 @@ void imap_do_fetch_msg(int seq, citimap_command *Cmd) { } 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); diff --git a/citadel/modules/imap/imap_search.c b/citadel/modules/imap/imap_search.c index f1b7f73e9..5f4f1fee9 100644 --- a/citadel/modules/imap/imap_search.c +++ b/citadel/modules/imap/imap_search.c @@ -1,7 +1,7 @@ /* * 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. @@ -115,7 +115,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, 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) { @@ -132,7 +132,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, 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) { @@ -158,7 +158,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, /* 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) { @@ -173,7 +173,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, 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) { @@ -219,7 +219,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, 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) { @@ -241,7 +241,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, * 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; } @@ -271,7 +271,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, 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) { @@ -298,7 +298,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, 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) { @@ -328,7 +328,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, 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) { @@ -344,7 +344,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, 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) { @@ -360,7 +360,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, 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) { @@ -376,7 +376,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, 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) { @@ -392,7 +392,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, 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) { @@ -405,7 +405,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, 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) { @@ -418,7 +418,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, 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) { @@ -433,7 +433,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg, 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) { diff --git a/citadel/modules/inboxrules/serv_inboxrules.c b/citadel/modules/inboxrules/serv_inboxrules.c index ccc0cfe10..fa9cca82a 100644 --- a/citadel/modules/inboxrules/serv_inboxrules.c +++ b/citadel/modules/inboxrules/serv_inboxrules.c @@ -75,7 +75,7 @@ int ctdl_redirect(void) 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); @@ -427,7 +427,7 @@ int ctdl_getheaders(sieve2_context_t *s, void *my) { /* * 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; @@ -449,7 +449,7 @@ void sieve_do_msg(long msgnum, void *userdata) { /* * 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; /* @@ -996,14 +996,19 @@ struct inboxrules *deserialize_inbox_rules(char *serialized_rules) { /* - * 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, + +} /* @@ -1020,7 +1025,7 @@ void do_inbox_processing_for_user(long usernum) { 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 } @@ -1042,7 +1047,7 @@ void do_inbox_processing_for_user(long usernum) { 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); } @@ -1054,7 +1059,7 @@ void do_inbox_processing_for_user(long usernum) { /* * 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; @@ -1133,7 +1138,7 @@ void cmd_gibr(char *argbuf) { 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; @@ -1184,7 +1189,7 @@ void cmd_pibr(char *argbuf) { // 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]; diff --git a/citadel/modules/inetcfg/serv_inetcfg.c b/citadel/modules/inetcfg/serv_inetcfg.c index 29e6f3cbb..971c672cf 100644 --- a/citadel/modules/inetcfg/serv_inetcfg.c +++ b/citadel/modules/inetcfg/serv_inetcfg.c @@ -4,7 +4,7 @@ * 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. @@ -116,7 +116,7 @@ int inetcfg_aftersave(struct CtdlMessage *msg, recptypes *recp) { 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); diff --git a/citadel/modules/migrate/serv_migrate.c b/citadel/modules/migrate/serv_migrate.c index f6d705568..d982dd2d2 100644 --- a/citadel/modules/migrate/serv_migrate.c +++ b/citadel/modules/migrate/serv_migrate.c @@ -328,7 +328,7 @@ void migr_export_message(long msgnum) { /* Ok, here we go ... */ - msg = CtdlFetchMessage(msgnum, 1, 0); + msg = CtdlFetchMessage(msgnum, 1); if (msg == NULL) return; /* fail silently */ client_write(HKEY("\n")); @@ -949,7 +949,7 @@ int migr_restore_message_metadata(long msgnum, int refcount) /* Ok, here we go ... */ - msg = CtdlFetchMessage(msgnum, 1, 0); + msg = CtdlFetchMessage(msgnum, 1); if (msg == NULL) { return 1; } diff --git a/citadel/modules/network/serv_netmail.c b/citadel/modules/network/serv_netmail.c index b4c5f713b..60b779da4 100644 --- a/citadel/modules/network/serv_netmail.c +++ b/citadel/modules/network/serv_netmail.c @@ -426,7 +426,7 @@ void network_spool_msg(long msgnum, void *userdata) SpoolControl *sc; sc = (SpoolControl *)userdata; - msg = CtdlFetchMessage(msgnum, 1, 1); + msg = CtdlFetchMessage(msgnum, 1); if (msg == NULL) { diff --git a/citadel/modules/network/serv_netspool.c b/citadel/modules/network/serv_netspool.c index aaabffa18..5055eabfa 100644 --- a/citadel/modules/network/serv_netspool.c +++ b/citadel/modules/network/serv_netspool.c @@ -2,7 +2,7 @@ * 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. @@ -217,7 +217,7 @@ void CalcListID(SpoolControl *sc) #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); diff --git a/citadel/modules/nntp/serv_nntp.c b/citadel/modules/nntp/serv_nntp.c index 14f75db6c..93f65da0a 100644 --- a/citadel/modules/nntp/serv_nntp.c +++ b/citadel/modules/nntp/serv_nntp.c @@ -1,7 +1,7 @@ // // 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. @@ -977,7 +977,7 @@ void nntp_xover_backend(long msgnum, void *userdata) { 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; } diff --git a/citadel/modules/smtp/serv_smtp.c b/citadel/modules/smtp/serv_smtp.c index 5fbc5003c..eeace012e 100644 --- a/citadel/modules/smtp/serv_smtp.c +++ b/citadel/modules/smtp/serv_smtp.c @@ -20,7 +20,7 @@ * 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. @@ -326,7 +326,7 @@ void smtp_webcit_preferences_hack_backend(long msgnum, void *userdata) { return; // already got it } - msg = CtdlFetchMessage(msgnum, 1, 1); + msg = CtdlFetchMessage(msgnum, 1); if (msg == NULL) { return; } diff --git a/citadel/modules/smtp/serv_smtpclient.c b/citadel/modules/smtp/serv_smtpclient.c index 1b7595df0..70db0a116 100644 --- a/citadel/modules/smtp/serv_smtpclient.c +++ b/citadel/modules/smtp/serv_smtpclient.c @@ -3,7 +3,7 @@ * * 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 @@ -360,7 +360,7 @@ void smtp_process_one_msg(long qmsgnum) 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; diff --git a/citadel/modules/vcard/serv_vcard.c b/citadel/modules/vcard/serv_vcard.c index 1d0e2909d..21a99b2d0 100644 --- a/citadel/modules/vcard/serv_vcard.c +++ b/citadel/modules/vcard/serv_vcard.c @@ -2,7 +2,7 @@ * 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. @@ -508,7 +508,7 @@ struct vCard *vcard_get_user(struct ctdluser *u) { 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]); @@ -868,7 +868,7 @@ void dvca_mime_callback(char *name, char *filename, char *partnum, char *disp, 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 */ @@ -1087,7 +1087,7 @@ void strip_addresses_already_have(long msgnum, void *userdata) { 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); diff --git a/citadel/modules/wiki/serv_wiki.c b/citadel/modules/wiki/serv_wiki.c index 9851bf537..ff7eec22d 100644 --- a/citadel/modules/wiki/serv_wiki.c +++ b/citadel/modules/wiki/serv_wiki.c @@ -1,7 +1,7 @@ /* * 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. @@ -140,7 +140,7 @@ int wiki_upload_beforesave(struct CtdlMessage *msg, recptypes *recp) { /* 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; @@ -221,7 +221,7 @@ int wiki_upload_beforesave(struct CtdlMessage *msg, recptypes *recp) { 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 */ @@ -405,7 +405,7 @@ void wiki_history(char *pagename) { 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; @@ -537,7 +537,7 @@ void wiki_rev(char *pagename, char *rev, char *operation) */ msgnum = CtdlLocateMessageByEuid(pagename, &CCC->room); if (msgnum > 0L) { - msg = CtdlFetchMessage(msgnum, 1, 1); + msg = CtdlFetchMessage(msgnum, 1); } else { msg = NULL; @@ -571,7 +571,7 @@ void wiki_rev(char *pagename, char *rev, char *operation) 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; diff --git a/citadel/modules/xmpp/xmpp_presence.c b/citadel/modules/xmpp/xmpp_presence.c index 8fa6dea7f..ee7d56991 100644 --- a/citadel/modules/xmpp/xmpp_presence.c +++ b/citadel/modules/xmpp/xmpp_presence.c @@ -1,7 +1,7 @@ /* * 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 @@ -224,7 +224,7 @@ void xmpp_fetch_mortuary_backend(long msgnum, void *userdata) { char *ptr = NULL; char *lasts = NULL; - msg = CtdlFetchMessage(msgnum, 1, 1); + msg = CtdlFetchMessage(msgnum, 1); if (msg == NULL) { return; } diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 0b4ed5c59..ae745958b 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -756,7 +756,7 @@ int CtdlForEachMessage(int mode, long ref, char *search_string, 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; @@ -1163,7 +1163,7 @@ struct CtdlMessage *CtdlDeserializeMessage(long msgnum, int with_body, const cha * 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; @@ -1204,12 +1204,6 @@ struct CtdlMessage *CtdlFetchMessage(long msgnum, int with_body, int run_msg_hoo 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); } @@ -1596,10 +1590,10 @@ int CtdlOutputMsg(long msg_num, /* message number (local) to fetch */ * 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) { @@ -2394,7 +2388,7 @@ int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newms msg = supplied_msg; } else { - msg = CtdlFetchMessage(msgid, 0, 1); + msg = CtdlFetchMessage(msgid, 0); } if (msg != NULL) { diff --git a/citadel/msgbase.h b/citadel/msgbase.h index 308c3aa33..c990b23b2 100644 --- a/citadel/msgbase.h +++ b/citadel/msgbase.h @@ -105,7 +105,7 @@ void CtdlWriteObject(char *req_room, /* Room to stuff it in */ 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); diff --git a/citadel/server.h b/citadel/server.h index 91b144f0d..58b7f9770 100644 --- a/citadel/server.h +++ b/citadel/server.h @@ -233,7 +233,6 @@ struct cdbdata { #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 */ -- 2.30.2