int instance = 0;
int found_something = 0;
- if (msg->cm_fields['A'] == NULL) return;
- if (msg->cm_fields['N'] == NULL) return;
+ if (msg->cm_fields[eAuthor] == NULL) return;
+ if (msg->cm_fields[eNodeName] == NULL) return;
snprintf(citadel_address, sizeof citadel_address, "%s @ %s",
- msg->cm_fields['A'], msg->cm_fields['N']);
+ msg->cm_fields[eAuthor], msg->cm_fields[eNodeName]);
- v = vcard_load(msg->cm_fields['M']);
+ v = vcard_load(msg->cm_fields[eMesageText]);
if (v == NULL) return;
/* Go through the vCard searching for *all* instances of
/* Ok, if we got this far, look into the situation further... */
- ptr = msg->cm_fields['M'];
+ ptr = msg->cm_fields[eMesageText];
if (ptr == NULL) return(0);
- mime_parser(msg->cm_fields['M'],
+ mime_parser(msg->cm_fields[eMesageText],
NULL,
*vcard_extract_vcard,
NULL, NULL,
CtdlDeleteMessages(CCC->room.QRname, NULL, 0, "[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$");
/* Make the author of the message the name of the user. */
- if (msg->cm_fields['A'] != NULL) {
- free(msg->cm_fields['A']);
+ if (msg->cm_fields[eAuthor] != NULL) {
+ free(msg->cm_fields[eAuthor]);
}
- msg->cm_fields['A'] = strdup(usbuf.fullname);
+ msg->cm_fields[eAuthor] = strdup(usbuf.fullname);
}
/* Insert or replace RFC2739-compliant free/busy URL */
/* Enforce local UID policy if applicable */
if (yes_my_citadel_config) {
- snprintf(buf, sizeof buf, VCARD_EXT_FORMAT, msg->cm_fields['A'], NODENAME);
+ snprintf(buf, sizeof buf, VCARD_EXT_FORMAT, msg->cm_fields[eAuthor], NODENAME);
vcard_set_prop(v, "UID", buf, 0);
}
/*
* Set the EUID of the message to the UID of the vCard.
*/
- if (msg->cm_fields['E'] != NULL)
+ if (msg->cm_fields[eExclusiveID] != NULL)
{
- free(msg->cm_fields['E']);
- msg->cm_fields['E'] = NULL;
+ free(msg->cm_fields[eExclusiveID]);
+ msg->cm_fields[eExclusiveID] = NULL;
}
s = vcard_get_prop(v, "UID", 1, 0, 0);
if (s != NULL) {
- msg->cm_fields['E'] = strdup(s);
- if (msg->cm_fields['U'] == NULL) {
- msg->cm_fields['U'] = strdup(s);
+ msg->cm_fields[eExclusiveID] = strdup(s);
+ if (msg->cm_fields[eMsgSubject] == NULL) {
+ msg->cm_fields[eMsgSubject] = strdup(s);
}
}
s = vcard_get_prop(v, "N", 1, 0, 0);
}
if (s != NULL) {
- 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'] = strdup(s);
+ msg->cm_fields[eMsgSubject] = strdup(s);
}
/* Re-serialize it back into the msg body */
ser = vcard_serialize(v);
if (ser != NULL) {
- msg->cm_fields['M'] = realloc(msg->cm_fields['M'], strlen(ser) + 1024);
- sprintf(msg->cm_fields['M'],
+ msg->cm_fields[eMesageText] = realloc(msg->cm_fields[eMesageText], strlen(ser) + 1024);
+ sprintf(msg->cm_fields[eMesageText],
"Content-type: " VCARD_MIME_TYPE
"\r\n\r\n%s\r\n", ser);
free(ser);
if (!is_UserConf && !is_GAB) return(0);
- ptr = msg->cm_fields['M'];
+ ptr = msg->cm_fields[eMesageText];
if (ptr == NULL) return(0);
NewStrBufDupAppendFlush(&CCC->StatusMessage, NULL, NULL, 0);
* copy it to the Global Address Book room.
*/
- I = atol(msg->cm_fields['3']);
+ I = atol(msg->cm_fields[eVltMsgNum]);
if (I <= 0L) return(0);
/* Store our Internet return address in memory */
if (is_MY_UserConf) {
- v = vcard_load(msg->cm_fields['M']);
+ v = vcard_load(msg->cm_fields[eMesageText]);
extract_inet_email_addrs(CCC->cs_inet_email, sizeof CCC->cs_inet_email,
CCC->cs_inet_other_emails, sizeof CCC->cs_inet_other_emails,
v, 1);
msg = CtdlFetchMessage(VCmsgnum, 1);
if (msg == NULL) return vcard_new();
- v = vcard_load(msg->cm_fields['M']);
+ v = vcard_load(msg->cm_fields[eMesageText]);
CtdlFreeMessage(msg);
return v;
}
msg->cm_magic = CTDLMESSAGE_MAGIC;
msg->cm_anon_type = MES_NORMAL;
msg->cm_format_type = 0;
- msg->cm_fields['A'] = strdup(usbuf->fullname);
- msg->cm_fields['O'] = strdup(ADDRESS_BOOK_ROOM);
- msg->cm_fields['N'] = strdup(NODENAME);
- msg->cm_fields['M'] = strdup("Purge this vCard\n");
+ msg->cm_fields[eAuthor] = strdup(usbuf->fullname);
+ msg->cm_fields[eOriginalRoom] = strdup(ADDRESS_BOOK_ROOM);
+ msg->cm_fields[eNodeName] = strdup(NODENAME);
+ msg->cm_fields[eMesageText] = strdup("Purge this vCard\n");
snprintf(buf, sizeof buf, VCARD_EXT_FORMAT,
- msg->cm_fields['A'], NODENAME);
- msg->cm_fields['E'] = strdup(buf);
+ msg->cm_fields[eAuthor], NODENAME);
+ msg->cm_fields[eExclusiveID] = strdup(buf);
- msg->cm_fields['S'] = strdup("CANCEL");
+ msg->cm_fields[eSpecialField] = strdup("CANCEL");
CtdlSubmitMsg(msg, NULL, ADDRESS_BOOK_ROOM, QP_EADDR);
CtdlFreeMessage(msg);
if (msg->cm_format_type != 4) return(0);
- ptr = msg->cm_fields['M'];
+ ptr = msg->cm_fields[eMesageText];
if (ptr == NULL) return(0);
while (ptr != NULL) {
msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) return;
- ptr = msg->cm_fields['M'];
+ ptr = msg->cm_fields[eMesageText];
if (ptr == NULL) goto EOH;
while (ptr != NULL) {
linelen = strcspn(ptr, "\n");
msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) return;
- mime_parser(msg->cm_fields['M'],
+ mime_parser(msg->cm_fields[eMesageText],
NULL,
*dvca_mime_callback, /* callback function */
NULL, NULL,
msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) return;
- v = vcard_load(msg->cm_fields['M']);
+ v = vcard_load(msg->cm_fields[eMesageText]);
CtdlFreeMessage(msg);
i = 0;
vmsg->cm_magic = CTDLMESSAGE_MAGIC;
vmsg->cm_anon_type = MES_NORMAL;
vmsg->cm_format_type = FMT_RFC822;
- vmsg->cm_fields['A'] = strdup("Citadel");
- vmsg->cm_fields['E'] = strdup(vcard_get_prop(v, "UID", 1, 0, 0));
+ vmsg->cm_fields[eAuthor] = strdup("Citadel");
+ vmsg->cm_fields[eExclusiveID] = strdup(vcard_get_prop(v, "UID", 1, 0, 0));
ser = vcard_serialize(v);
if (ser != NULL) {
- vmsg->cm_fields['M'] = malloc(strlen(ser) + 1024);
- sprintf(vmsg->cm_fields['M'],
+ vmsg->cm_fields[eMesageText] = malloc(strlen(ser) + 1024);
+ sprintf(vmsg->cm_fields[eMesageText],
"Content-type: " VCARD_MIME_TYPE
"\r\n\r\n%s\r\n", ser);
free(ser);