int printed_lastold = 0;
int num_search_msgs = 0;
long *search_msgs = NULL;
+ regex_t re;
+ regmatch_t pm;
+
+ if (content_type) if (strlen(content_type) > 0) {
+ regcomp(&re, content_type, 0);
+ }
/* Learn about the user and room in question */
getuser(&CC->user, CC->curr_user);
*/
GetMetaData(&smi, msglist[a]);
- if (strcasecmp(smi.meta_content_type, content_type)) {
+ /* if (strcasecmp(smi.meta_content_type, content_type)) { old non-regex way */
+ if (regexec(&re, smi.meta_content_type, 1, &pm, 0) != 0) {
msglist[a] = 0L;
}
}
cprintf("%d Conflicting events:\n", LISTING_FOLLOWS);
- CtdlForEachMessage(MSGS_ALL, 0, NULL, "text/calendar",
+ CtdlForEachMessage(MSGS_ALL, 0, NULL, "^[Tt][Ee][Xx][Tt]/[Cc][Aa][Ll][Ee][Nn][Dd][Aa][Rr]$",
NULL,
ical_hunt_for_conflicts_backend,
(void *) cal
/* Add busy time from events */
lprintf(CTDL_DEBUG, "Adding busy time from events\n");
- CtdlForEachMessage(MSGS_ALL, 0, NULL, "text/calendar",
+ CtdlForEachMessage(MSGS_ALL, 0, NULL, "^[Tt][Ee][Xx][Tt]/[Cc][Aa][Ll][Ee][Nn][Dd][Aa][Rr]$",
NULL, ical_freebusy_backend, (void *)fb
);
/* Now go through the room encapsulating all calendar items. */
CtdlForEachMessage(MSGS_ALL, 0, NULL,
- "text/calendar",
+ "^[Tt][Ee][Xx][Tt]/[Cc][Aa][Ll][Ee][Nn][Dd][Aa][Rr]$",
NULL,
ical_getics_backend,
(void *) encaps
CtdlDirectoryInit();
/* We want *all* vCards in this room */
- CtdlForEachMessage(MSGS_ALL, 0, NULL, "text/x-vcard",
+ CtdlForEachMessage(MSGS_ALL, 0, NULL, "^[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$",
NULL, vcard_add_to_directory, NULL);
getroom(&CC->room, hold_rm); /* return to saved room */
/* We want the last (and probably only) vcard in this room */
VCmsgnum = (-1);
- CtdlForEachMessage(MSGS_LAST, 1, NULL, "text/x-vcard",
+ CtdlForEachMessage(MSGS_LAST, 1, NULL, "^[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$",
NULL, vcard_gu_backend, (void *)&VCmsgnum );
getroom(&CC->room, hold_rm); /* return to saved room */
/* First remove any addresses we already have in the address book */
usergoto(aptr->roomname, 0, 0, NULL, NULL);
- CtdlForEachMessage(MSGS_ALL, 0, NULL, "text/x-vcard", NULL,
+ CtdlForEachMessage(MSGS_ALL, 0, NULL, "^[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$", NULL,
strip_addresses_already_have, aptr->collected_addresses);
if (strlen(aptr->collected_addresses) > 0)