Continue phase 2 of modules stuff.
[citadel.git] / citadel / modules / fulltext / serv_fulltext.c
index b5753fbf63c95e4e156082f36da568d6d8ea9485..ba3f948a01af4885838f2918864738f11e2914eb 100644 (file)
@@ -467,12 +467,24 @@ void initialize_ft_cache(void) {
 }
 
 
+void ft_delete_remove(char *room, long msgnum)
+{
+       if (room) return;
+       
+       /* Remove from fulltext index */
+       if (config.c_enable_fulltext) {
+               ft_index_message(msgnum, 0);
+       }
+}
+
 /*****************************************************************************/
 
 CTDL_MODULE_INIT(fulltext)
 {
        initialize_ft_cache();
        CtdlRegisterProtoHook(cmd_srch, "SRCH", "Full text search");
+       CtdlRegisterDeleteHook(ft_delete_remove);
+       CtdlRegisterSearchFuncHook(ft_search, "fulltext");
        CtdlRegisterMaintenanceThread ("indexer", indexer_thread);
 
        /* return our Subversion id for the Log */