#include "euidindex.h"
#include "msgbase.h"
#include "journaling.h"
+#include "modules/fulltext/serv_fulltext.h"
struct addresses_to_be_filed *atbf = NULL;
int is_seen = 0;
long lastold = 0L;
int printed_lastold = 0;
- int num_search_msgs = 0;
- long *search_msgs = NULL;
regex_t re;
int need_to_free_re = 0;
regmatch_t pm;
+ Array *search = NULL;
if ((content_type) && (!IsEmptyStr(content_type))) {
regcomp(&re, content_type, 0);
* NULL means use any search function available.
* otherwise replace with a char * to name of search routine
*/
- CtdlModuleDoSearch(search_string, "fulltext");
- //FIXME FOOFOO DO ARRAY
+ search = CtdlFullTextSearch(search_string);
- if (num_search_msgs > 0) {
+ if (array_len(search) > 0) {
int orig_num_msgs;
orig_num_msgs = num_msgs;
num_msgs = 0;
for (i=0; i<orig_num_msgs; ++i) {
- for (j=0; j<num_search_msgs; ++j) {
- if (msglist[i] == search_msgs[j]) {
+ for (j=0; j<array_len(search); ++j) {
+ long smsgnum;
+ memcpy(&smsgnum, array_get_element_at(search, j), sizeof(long));
+ if (msglist[i] == smsgnum) {
msglist[num_msgs++] = msglist[i];
}
}
else {
num_msgs = 0; /* No messages qualify */
}
- if (search_msgs != NULL) free(search_msgs);
+ if (search != NULL) array_free(search);
/* Now that we've purged messages which don't contain the search
* string, treat a MSGS_SEARCH just like a MSGS_ALL from this