Accidentally merged the configdb branch into master. Reverting.
[citadel.git] / citadel / modules / fulltext / serv_fulltext.c
index cc3906867981e6154ec43d1fc93b586cec0f212d..6288bfc9ab99adb0a240c99b739aab54da32622e 100644 (file)
@@ -126,9 +126,9 @@ void ft_index_message(long msgnum, int op) {
                return;
        }
 
-       if (msg->cm_fields['1'] != NULL) {
+       if (!CM_IsEmpty(msg, eSuppressIdx)) {
                syslog(LOG_DEBUG, "ft_index_message() excluded msg %ld", msgnum);
-               CtdlFreeMessage(msg);
+               CM_Free(msg);
                return;
        }
 
@@ -139,12 +139,11 @@ void ft_index_message(long msgnum, int op) {
         */
        CC->redirect_buffer = NewStrBufPlain(NULL, SIZ);
        CtdlOutputPreLoadedMsg(msg, MT_CITADEL, HEADERS_ALL, 0, 1, 0);
-       CtdlFreeMessage(msg);
+       CM_Free(msg);
        msgtext = CC->redirect_buffer;
        CC->redirect_buffer = NULL;
-       syslog(LOG_DEBUG, "Wordbreaking message %ld...", msgnum);
-       if ((msgtext == NULL) || (StrLength(msgtext) == 0)) {
-               syslog(LOG_ALERT, "This message has a zero length.  Probable data corruption.");
+       if (msgtext != NULL) {
+               syslog(LOG_DEBUG, "Wordbreaking message %ld (%d bytes)", msgnum, StrLength(msgtext));
        }
        txt = SmashStrBuf(&msgtext);
        wordbreaker(txt, &num_tokens, &tokens);
@@ -507,7 +506,7 @@ CTDL_MODULE_INIT(fulltext)
                CtdlRegisterDeleteHook(ft_delete_remove);
                CtdlRegisterSearchFuncHook(ft_search, "fulltext");
                CtdlRegisterCleanupHook(noise_word_cleanup);
-               CtdlRegisterSessionHook(do_fulltext_indexing, EVT_TIMER);
+               CtdlRegisterSessionHook(do_fulltext_indexing, EVT_TIMER, PRIO_CLEANUP + 300);
        }
        /* return our module name for the log */
        return "fulltext";