+
+
+/*
+ * Callback for vcard_add_to_directory()
+ * (Lotsa ugly nested callbacks. Oh well.)
+ * This little shim function makes sure we're not
+ */
+void vcard_directory_add_user(char *internet_addr, char *citadel_addr) {
+ char buf[SIZ];
+
+ /* We have to validate that we're not stepping on someone else's
+ * email address ... but only if we're logged in. Otherwise it's
+ * probably just the networker or something.
+ */
+ if (CC->logged_in) {
+ lprintf(9, "Checking for <%s>...\n", internet_addr);
+ if (CtdlDirectoryLookup(buf, internet_addr) == 0) {
+ if (strcasecmp(buf, citadel_addr)) {
+ /* This address belongs to someone else.
+ * Bail out silently without saving.
+ */
+ lprintf(9, "DOOP!\n");
+ return;
+ }
+ }
+ }
+ lprintf(9, "ADDING!\n");
+ CtdlDirectoryAddUser(internet_addr, citadel_addr);
+}
+
+