}
if (p != NULL) {
strcpy(imm->uid, icalproperty_get_comment(p));
- strcpy(imm->subject,
- icalproperty_get_comment(p));
+ /* strcpy(imm->subject, icalproperty_get_comment(p)); old aethera hack */
}
p = ical_ctdl_get_subprop(cal, ICAL_SUMMARY_PROPERTY);
if (p != NULL) {
- strcat(imm->subject, " ");
- strcat(imm->subject,
- icalproperty_get_comment(p));
+ strcpy(imm->subject, icalproperty_get_comment(p));
}
p = ical_ctdl_get_subprop(cal, ICAL_DTSTART_PROPERTY);
if (p != NULL) {
/*
* Set the EUID of the message to the UID of the vCard.
- * Also set the Subject if there isn't already one.
*/
if (msg->cm_fields['E'] != NULL) free(msg->cm_fields['E']);
s = vcard_get_prop(v, "UID", 0, 0, 0);
}
}
+ /*
+ * If the message has no Subject, set it to the name in
+ * the vCard.
+ */
+ if (msg->cm_fields['U'] == NULL) {
+ s = vcard_get_prop(v, "FN", 0, 0, 0);
+ if (s == NULL) {
+ s = vcard_get_prop(v, "N", 0, 0, 0);
+ }
+ if (s != NULL) {
+ msg->cm_fields['U'] = strdup(s);
+ }
+ }
+
/* Re-serialize it back into the msg body */
ser = vcard_serialize(v);
if (ser != NULL) {