/*
* Set the EUID of the message to the UID of the vCard.
*/
- if (msg->cm_fields['E'] != NULL) free(msg->cm_fields['E']);
+ if (msg->cm_fields['E'] != NULL)
+ {
+ free(msg->cm_fields['E']);
+ msg->cm_fields['E'] = NULL;
+ }
s = vcard_get_prop(v, "UID", 0, 0, 0);
if (s != NULL) {
msg->cm_fields['E'] = strdup(s);
+
+
+/*
+ * Add an email alias to a users vcard
+ */
+
+void vcard_add_alias(struct ctdluser *usbuf, char *addr)
+{
+ struct vCard *v;
+
+ v = vcard_get_user(usbuf);
+ vcard_add_prop(v, "email;internet", addr);
+ vcard_write_user(usbuf, v);
+ vcard_free(v);
+}
+
+
+
+
/*
* When a user is being created, create his/her vCard.
*/