+void extract_preferred(char *name, char *filename, char *partnum, char *disp,
+ void *content, char *cbtype, char *cbcharset,
+ size_t length, char *encoding, void *userdata)
+{
+ struct epdata *epdata = (struct epdata *)userdata;
+ int hit = 0;
+
+ /* We only want the first one that we found */
+ if (!IsEmptyStr(epdata->found_section)) return;
+
+ /* Check for a content type match */
+ if (strlen(epdata->desired_content_type_1) > 0) {
+ if (!strcasecmp(epdata->desired_content_type_1, cbtype)) {
+ hit = 1;
+ }
+ }
+ if (!IsEmptyStr(epdata->desired_content_type_2)) {
+ if (!strcasecmp(epdata->desired_content_type_2, cbtype)) {
+ hit = 1;
+ }
+ }
+
+ /* Is this the one? If so, output it. */
+ if (hit) {
+ safestrncpy(epdata->found_section, partnum, sizeof epdata->found_section);
+ if (!IsEmptyStr(cbcharset)) {
+ safestrncpy(epdata->charset, cbcharset, sizeof epdata->charset);
+ }
+ hprintf("Content-type: %s; charset=%s\r\n", cbtype, epdata->charset);
+ begin_burst();
+ StrBufAppendBufPlain(WC->WBuf, content, length, 0);
+ end_burst();
+ }
+}
+
+
+
+/*
+ * The pathname is always going to take one of two formats:
+ * /groupdav/room_name/euid (GroupDAV)
+ * /groupdav/room_name (webcal)
+ */
+void groupdav_get(const char *dav_pathname) {
+ char dav_roomname[1024];
+ char dav_uid[1024];