]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_vcard.c
* Use syslog-compatible logging levels in lprintf(); the loglevel chosen
[citadel.git] / citadel / serv_vcard.c
index 5ea0d40680b3cb3edd66d4af6c04c19ddb69c3a7..800dfcabb9b21e0858431ab0906a47a4640554d4 100644 (file)
@@ -146,18 +146,19 @@ void vcard_directory_add_user(char *internet_addr, char *citadel_addr) {
         * probably just the networker or something.
         */
        if (CC->logged_in) {
-               lprintf(9, "Checking for <%s>...\n", internet_addr);
+               lprintf(CTDL_DEBUG, "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");
+                               lprintf(CTDL_DEBUG, "DOOP!\n");
                                return;
                        }
                }
        }
-       lprintf(9, "ADDING!\n");
+       lprintf(CTDL_INFO, "Adding %s (%s) to directory\n",
+                       citadel_addr, internet_addr);
        CtdlDirectoryAddUser(internet_addr, citadel_addr);
 }
 
@@ -193,7 +194,7 @@ void cmd_igab(char *argbuf) {
 
         if (getroom(&CC->room, ADDRESS_BOOK_ROOM) != 0) {
                 getroom(&CC->room, hold_rm);
-               cprintf("%d cannot get address book room\n", ERROR);
+               cprintf("%d cannot get address book room\n", ERROR + ROOM_NOT_FOUND);
                return;
         }
 
@@ -517,7 +518,7 @@ void cmd_regi(char *argbuf) {
        char tmpcountry[SIZ];
 
        if (!(CC->logged_in)) {
-               cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
+               cprintf("%d Not logged in.\n",ERROR + NOT_LOGGED_IN);
                return;
        }
 
@@ -573,7 +574,7 @@ void cmd_greg(char *argbuf)
        extract(who, argbuf, 0);
 
        if (!(CC->logged_in)) {
-               cprintf("%d Not logged in.\n", ERROR+NOT_LOGGED_IN);
+               cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN);
                return;
        }
 
@@ -581,12 +582,12 @@ void cmd_greg(char *argbuf)
 
        if ((CC->user.axlevel < 6) && (strcasecmp(who,CC->curr_user))) {
                cprintf("%d Higher access required.\n",
-                       ERROR+HIGHER_ACCESS_REQUIRED);
+                       ERROR + HIGHER_ACCESS_REQUIRED);
                return;
        }
 
        if (getuser(&usbuf, who) != 0) {
-               cprintf("%d '%s' not found.\n", ERROR+NO_SUCH_USER, who);
+               cprintf("%d '%s' not found.\n", ERROR + NO_SUCH_USER, who);
                return;
        }
 
@@ -757,7 +758,7 @@ void cmd_qdir(char *argbuf) {
 
        if (CtdlDirectoryLookup(citadel_addr, internet_addr) != 0) {
                cprintf("%d %s was not found.\n",
-                       ERROR+NO_SUCH_USER, internet_addr);
+                       ERROR + NO_SUCH_USER, internet_addr);
                return;
        }
 
@@ -778,7 +779,7 @@ void vcard_create_room(void)
 
        /* Set expiration policy to manual; otherwise objects will be lost! */
        if (lgetroom(&qr, USERCONTACTSROOM)) {
-               lprintf(3, "Couldn't get the user CONTACTS room!\n");
+               lprintf(CTDL_ERR, "Couldn't get the user CONTACTS room!\n");
                return;
        }
        qr.QRep.expire_mode = EXPIRE_MANUAL;