Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
[citadel.git] / citadel / modules / vcard / serv_vcard.c
index 12e39696d4a9c2554d33a6af8273057a6d94aca2..5c3a3a7259adfad4a3ef82f8963e23d3742e7a8b 100644 (file)
  * set global flag calling for an aide to validate new users
  */
 void set_mm_valid(void) {
+       int flags = 0;
+
        begin_critical_section(S_CONTROL);
-       get_control();
-       CitControl.MMflags = CitControl.MMflags | MM_VALID ;
-       put_control();
+       flags = CtdlGetConfigInt("MMflags");
+       flags = flags | MM_VALID ;
+       CtdlSetConfigInt("MMflags", flags);
        end_critical_section(S_CONTROL);
 }
 
@@ -185,7 +187,7 @@ int vcard_directory_add_user(char *internet_addr, char *citadel_addr) {
 void vcard_add_to_directory(long msgnum, void *data) {
        struct CtdlMessage *msg;
 
-       msg = CtdlFetchMessage(msgnum, 1);
+       msg = CtdlFetchMessage(msgnum, 1, 1);
        if (msg != NULL) {
                vcard_extract_internet_addresses(msg, vcard_directory_add_user);
        }
@@ -653,7 +655,7 @@ struct vCard *vcard_get_user(struct ctdluser *u) {
 
        if (VCmsgnum < 0L) return vcard_new();
 
-       msg = CtdlFetchMessage(VCmsgnum, 1);
+       msg = CtdlFetchMessage(VCmsgnum, 1, 1);
        if (msg == NULL) return vcard_new();
 
        v = vcard_load(msg->cm_fields[eMesageText]);
@@ -878,7 +880,7 @@ void vcard_newuser(struct ctdluser *usbuf) {
 #endif // HAVE_GETPWUID_R
                        snprintf(buf, sizeof buf, "%s@%s", pwd.pw_name, CtdlGetConfigStr("c_fqdn"));
                        vcard_add_prop(v, "email;internet", buf);
-                       need_default_vcard=0;
+                       need_default_vcard = 0;
                }
        }
 #endif
@@ -899,7 +901,7 @@ void vcard_newuser(struct ctdluser *usbuf) {
                if (Ctdl_LDAP_to_vCard(ldap_dn, v)) {
                        /* Allow global address book and internet directory update without login long enough to write this. */
                        CC->vcard_updated_by_ldap++;  /* Otherwise we'll only update the user config. */
-                       need_default_vcard=0;
+                       need_default_vcard = 0;
                        syslog(LOG_DEBUG, "LDAP Created Initial Vcard for %s\n",usbuf->fullname);
                }
            }
@@ -1010,7 +1012,7 @@ void vcard_delete_remove(char *room, long msgnum) {
                return;
        }
 
-       msg = CtdlFetchMessage(msgnum, 1);
+       msg = CtdlFetchMessage(msgnum, 1, 1);
        if (msg == NULL) return;
 
        if (CM_IsEmpty(msg, eMesageText))
@@ -1137,7 +1139,7 @@ void dvca_mime_callback(char *name, char *filename, char *partnum, char *disp,
 void dvca_callback(long msgnum, void *userdata) {
        struct CtdlMessage *msg = NULL;
 
-       msg = CtdlFetchMessage(msgnum, 1);
+       msg = CtdlFetchMessage(msgnum, 1, 1);
        if (msg == NULL) return;
        mime_parser(CM_RANGE(msg, eMesageText),
                    *dvca_mime_callback,        /* callback function */
@@ -1361,7 +1363,7 @@ void strip_addresses_already_have(long msgnum, void *userdata) {
 
        collected_addresses = (char *)userdata;
 
-       msg = CtdlFetchMessage(msgnum, 1);
+       msg = CtdlFetchMessage(msgnum, 1, 1);
        if (msg == NULL) return;
        v = vcard_load(msg->cm_fields[eMesageText]);
        CM_Free(msg);