msg->cm_magic = CTDLMESSAGE_MAGIC;
msg->cm_anon_type = MES_NORMAL;
msg->cm_format_type = 4;
- msg->cm_fields['A'] = strdup(CC->user.fullname);
- msg->cm_fields['O'] = strdup(CC->room.QRname);
- msg->cm_fields['N'] = strdup(config.c_nodename);
- msg->cm_fields['H'] = strdup(config.c_humannode);
- msg->cm_fields['M'] = malloc(strlen(ser) + 40);
- strcpy(msg->cm_fields['M'], "Content-type: text/calendar\r\n\r\n");
- strcat(msg->cm_fields['M'], ser);
+ msg->cm_fields[eAuthor] = strdup(CC->user.fullname);
+ msg->cm_fields[eOriginalRoom] = strdup(CC->room.QRname);
+ msg->cm_fields[eNodeName] = strdup(config.c_nodename);
+ msg->cm_fields[eHumanNode] = strdup(config.c_humannode);
+ msg->cm_fields[eMesageText] = malloc(strlen(ser) + 40);
+ strcpy(msg->cm_fields[eMesageText], "Content-type: text/calendar\r\n\r\n");
+ strcat(msg->cm_fields[eMesageText], ser);
/* Now write the data */
CtdlSubmitMsg(msg, NULL, "", QP_EADDR);
memset(&ird, 0, sizeof ird);
strcpy(ird.desired_partnum, partnum);
- mime_parser(msg->cm_fields['M'],
+ mime_parser(msg->cm_fields[eMesageText],
NULL,
*ical_locate_part, /* callback function */
NULL, NULL,
return(2); /* internal error */
}
oec.c = NULL;
- mime_parser(msg->cm_fields['M'],
+ mime_parser(msg->cm_fields[eMesageText],
NULL,
*ical_locate_original_event, /* callback function */
NULL, NULL,
memset(&ird, 0, sizeof ird);
strcpy(ird.desired_partnum, partnum);
- mime_parser(msg->cm_fields['M'],
+ mime_parser(msg->cm_fields[eMesageText],
NULL,
*ical_locate_part, /* callback function */
NULL, NULL,
if (msg == NULL) return;
memset(&ird, 0, sizeof ird);
strcpy(ird.desired_partnum, "_HUNT_");
- mime_parser(msg->cm_fields['M'],
+ mime_parser(msg->cm_fields[eMesageText],
NULL,
*ical_locate_part, /* callback function */
NULL, NULL,
memset(&ird, 0, sizeof ird);
strcpy(ird.desired_partnum, partnum);
- mime_parser(msg->cm_fields['M'],
+ mime_parser(msg->cm_fields[eMesageText],
NULL,
*ical_locate_part, /* callback function */
NULL, NULL,
if (msg == NULL) return;
memset(&ird, 0, sizeof ird);
strcpy(ird.desired_partnum, "_HUNT_");
- mime_parser(msg->cm_fields['M'],
+ mime_parser(msg->cm_fields[eMesageText],
NULL,
*ical_locate_part, /* callback function */
NULL, NULL,
if (msg == NULL) return;
memset(&ird, 0, sizeof ird);
strcpy(ird.desired_partnum, "_HUNT_");
- mime_parser(msg->cm_fields['M'],
+ mime_parser(msg->cm_fields[eMesageText],
NULL,
*ical_locate_part, /* callback function */
NULL, NULL,
if (p != NULL) {
safestrncpy(buf, icalproperty_get_comment(p), sizeof buf);
if (!IsEmptyStr(buf)) {
- if (msg->cm_fields['E'] != NULL) {
- free(msg->cm_fields['E']);
+ if (msg->cm_fields[eExclusiveID] != NULL) {
+ free(msg->cm_fields[eExclusiveID]);
}
- msg->cm_fields['E'] = strdup(buf);
+ msg->cm_fields[eExclusiveID] = strdup(buf);
syslog(LOG_DEBUG, "Saving calendar UID <%s>\n", buf);
}
}
if (p != NULL) {
safestrncpy(buf, icalproperty_get_comment(p), sizeof buf);
if (!IsEmptyStr(buf)) {
- if (msg->cm_fields['U'] != NULL) {
- free(msg->cm_fields['U']);
+ if (msg->cm_fields[eMsgSubject] != NULL) {
+ free(msg->cm_fields[eMsgSubject]);
}
- msg->cm_fields['U'] = rfc2047encode(buf, strlen(buf));
+ msg->cm_fields[eMsgSubject] = rfc2047encode(buf, strlen(buf));
}
}
time_t idtstart;
idtstart = icaltime_as_timet(icalproperty_get_dtstart(p));
if (idtstart > 0) {
- if (msg->cm_fields['T'] != NULL) {
- free(msg->cm_fields['T']);
+ if (msg->cm_fields[eTimestamp] != NULL) {
+ free(msg->cm_fields[eTimestamp]);
}
- msg->cm_fields['T'] = strdup("000000000000000000");
- sprintf(msg->cm_fields['T'], "%ld", idtstart);
+ msg->cm_fields[eTimestamp] = strdup("000000000000000000");
+ sprintf(msg->cm_fields[eTimestamp], "%ld", idtstart);
}
}
return(1); /* You tried to save a non-RFC822 message! */
}
- if (msg->cm_fields['M'] == NULL) {
+ if (msg->cm_fields[eMesageText] == NULL) {
return(1); /* You tried to save a null message! */
}
/* Do all of our lovely back-end parsing */
- mime_parser(msg->cm_fields['M'],
+ mime_parser(msg->cm_fields[eMesageText],
NULL,
*ical_obj_beforesave_backend,
NULL, NULL,
if (msg->cm_format_type != 4) return(1);
/* Reject null messages */
- if (msg->cm_fields['M'] == NULL) return(1);
+ if (msg->cm_fields[eMesageText] == NULL) return(1);
/* Now recurse through it looking for our icalendar data */
- mime_parser(msg->cm_fields['M'],
+ mime_parser(msg->cm_fields[eMesageText],
NULL,
*ical_obj_aftersave_backend,
NULL, NULL,