[srvx-commits] CVS: services/src mod-memoserv.c,1.5,1.6
Brought to you by:
entrope
From: Entrope <en...@us...> - 2003-09-05 13:41:34
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv1351 Modified Files: mod-memoserv.c Log Message: Correctly handle account unregistration Show dict_size(memos) instead of 0 for total count (thanks, wasted) Index: mod-memoserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/mod-memoserv.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** mod-memoserv.c 1 Sep 2003 14:45:42 -0000 1.5 --- mod-memoserv.c 5 Sep 2003 13:41:26 -0000 1.6 *************** *** 76,80 **** #define MSMSG_DELETED_ALL "Deleted all of your messages." #define MSMSG_USE_CONFIRM "Please use /msg $S DELETE * $bCONFIRM$b to delete $uall$u of your messages." ! #define MSMSG_STATUS_TOTAL "I have $b%ld$b memos in my database." #define MSMSG_STATUS_EXPIRED "$b%ld$b memos expired during the time I am awake." #define MSMSG_STATUS_SENT "$b%ld$b memos have been sent." --- 76,80 ---- #define MSMSG_DELETED_ALL "Deleted all of your messages." #define MSMSG_USE_CONFIRM "Please use /msg $S DELETE * $bCONFIRM$b to delete $uall$u of your messages." ! #define MSMSG_STATUS_TOTAL "I have $b%u$b memos in my database." #define MSMSG_STATUS_EXPIRED "$b%ld$b memos expired during the time I am awake." #define MSMSG_STATUS_SENT "$b%ld$b memos have been sent." *************** *** 114,118 **** static struct module *memoserv_module; static struct log_type *MS_LOG; ! static unsigned long memosTotal, memosSent, memosExpired; static struct dict *memos; /* memo_account->handle->handle -> memo_account */ --- 114,118 ---- static struct module *memoserv_module; static struct log_type *MS_LOG; ! static unsigned long memosSent, memosExpired; static struct dict *memos; /* memo_account->handle->handle -> memo_account */ *************** *** 415,419 **** static MODCMD_FUNC(cmd_status) { ! reply(MSMSG_STATUS_TOTAL, memosTotal); reply(MSMSG_STATUS_EXPIRED, memosExpired); reply(MSMSG_STATUS_SENT, memosSent); --- 415,419 ---- static MODCMD_FUNC(cmd_status) { ! reply(MSMSG_STATUS_TOTAL, dict_size(memos)); reply(MSMSG_STATUS_EXPIRED, memosExpired); reply(MSMSG_STATUS_SENT, memosSent); *************** *** 542,545 **** --- 542,551 ---- } + static void + memoserv_unreg_account(UNUSED_ARG(struct userNode *user), struct handle_info *handle) + { + dict_remove(memos, handle->handle); + } + int memoserv_init(void) *************** *** 550,553 **** --- 556,560 ---- reg_auth_func(memoserv_check_messages); reg_handle_rename_func(memoserv_rename_account); + reg_unreg_func(memoserv_unreg_account); conf_register_reload(memoserv_conf_read); reg_exit_func(memoserv_cleanup); |