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);
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");
}
-/*****************************************************************************/
-/* 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");
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";