-/*
+/*
* Index messages by EUID per room.
+ *
+ * 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.
+ *
+ * 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"
*
*/
-
-
/*
* Return nonzero if the supplied room is one which should have
* an EUID index.
}
-
-
-
-
/*
* Locate a message in a given room with a given euid, and return
* its message number.
return CtdlLocateMessageByEuid (euid, qrbuf);
}
+
long CtdlLocateMessageByEuid(char *euid, struct ctdlroom *qrbuf) {
char *key;
int key_len;
char *data;
int data_len;
- syslog(LOG_DEBUG, "euidindex: ndexing message #%ld <%s> in <%s>", msgnum, euid, qrbuf->QRname);
+ syslog(LOG_DEBUG, "euidindex: indexing message #%ld <%s> in <%s>", msgnum, euid, qrbuf->QRname);
key_len = strlen(euid) + sizeof(long) + 1;
key = malloc(key_len);
}
-
/*
* Called by rebuild_euid_index_for_room() to index one message.
*/
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);
"euidindex: rebuilding EUID index for <%s>",
rplist->name);
CtdlUserGoto(rplist->name, 0, 0, NULL, NULL, NULL, NULL);
- CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, NULL,
- rebuild_euid_index_for_msg, NULL);
+ CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, NULL, rebuild_euid_index_for_msg, NULL);
}
}
ptr = rplist;
}
-
/*
* Server command to fetch a message number given an euid.
*/
cprintf("%d not found\n", ERROR + MESSAGE_NOT_FOUND);
}
+
CTDL_MODULE_INIT(euidindex)
{
if (!threading) {