]> code.citadel.org Git - citadel.git/blobdiff - citadel/server/modules/ctdlproto/serv_user.c
GOTO no longer counts newly arrived mail in the inbox. BIFF now does this.
[citadel.git] / citadel / server / modules / ctdlproto / serv_user.c
index d88731745474b271871fdee9471903f5bb81bd1e..aa560ee4d3b1382e2f579c38e6fbf4d41ed2cfff 100644 (file)
@@ -26,7 +26,7 @@ void cmd_user(char *cmdbuf) {
        int a;
 
        extract_token(username, cmdbuf, 0, '|', sizeof username);
-       striplt(username);
+       string_trim(username);
        syslog(LOG_DEBUG, "user_ops: cmd_user(%s)", username);
 
        a = CtdlLoginExistingUser(username);
@@ -486,7 +486,7 @@ void ListThisUser(char *username, void *data) {
 void cmd_list(char *cmdbuf) {
        char searchstring[256];
        extract_token(searchstring, cmdbuf, 0, '|', sizeof searchstring);
-       striplt(searchstring);
+       string_trim(searchstring);
        cprintf("%d \n", LISTING_FOLLOWS);
        ForEachUser(ListThisUser, (void *)searchstring );
        cprintf("000\n");
@@ -774,11 +774,12 @@ void cmd_lout(char *argbuf) {
 }
 
 
-/*****************************************************************************/
-/*                      MODULE INITIALIZATION STUFF                          */
-/*****************************************************************************/
+void cmd_biff(char *argbuf) {                          // has new mail arrived?
+       cprintf("%d %d\n", CIT_OK, NewMailCount());
+}
 
 
+// Initialization function, called from modules_init.c
 char *ctdl_module_init_serv_user(void) {
        if (!threading) {
                CtdlRegisterProtoHook(cmd_user, "USER", "Submit username for login");
@@ -808,6 +809,7 @@ char *ctdl_module_init_serv_user(void) {
                CtdlRegisterProtoHook(cmd_renu, "RENU", "Rename a user");
                CtdlRegisterProtoHook(cmd_newu, "NEWU", "Log in as a new user");
                CtdlRegisterProtoHook(cmd_isme, "ISME", "Determine whether an email address belongs to a user");
+               CtdlRegisterProtoHook(cmd_biff, "BIFF", "Count new messages that have arrived in the inbox");
        }
        /* return our Subversion id for the Log */
        return "user";