Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(lib/acct.c): merge duplicated functions; unify deviated logic […
…ref: #50] * Add lib/acct.c to the source file lists * lib/CMakeLists.txt & lib/Makefile * Move functions free of bbsd globals in maple/acct.c to lib/acct.c: * keeplog() * maple/acct.c * util/account.c * util/brdstat.c * util/stopperm.c * acct_load() * maple/acct.c * maple/xchatd.c * util/bbsmail.c * util/stopperm.c * acct_save() * maple/acct.c * util/addsong.c * util/resetvmail.c * util/stopperm.c * util/template.c * util/tranufo.c * seek_log_email() * maple/acct.c (static) * util/stopperm.c * deny_log_email() * maple/acct.c * util/stopperm.c * static deny_add_email() * maple/acct.c * util/stopperm.c * add_deny_exer() (duplicated with maple/acct.c add_deny()) * util/stopperm.c * Other non-duplicated functions from maple/acct.c: * acct_userno() * maple/acct.c * addmoney() * addpoint1() * addpoint2() * ban_addr() * Add ban_addr_tlogger & ban_addr_tlogger_init() for log message output * allow_addr() * Drop the `#ifdef HAVE_WRITE` compilation condition * Make the function non-static * check_nckuemail() * find_same_email() * Refine the whitespace usage of function parameter lists * lib/acct.c keeplog(): * Redefine the formerly case where arg `mode` == 3 in util/account.c, which behaviored as rename+mark rather than load+mark, as the new case where arg `mode` == 4 * Refine the description for param `mode` for the easiness of comprehension * maple/acct.c add_deny(): * Move and merge the main logic to add_deny_exer() * util/stopperm.c add_deny_exer() -> lib/acct.c add_deny_exer(): * Make the behaviors consistent with the former add_deny() * Make suspension duration accumulate * Keep the content of user's FN_STOPPERM_LOG when appending messages, since suspension duration now accumulates * Unify the message text * maple/acct.c ban_addr() -> lib/acct.c ban_addr(): * Rewrite message logging with logger_tag() & TLogger * Add static TLogger object ban_addr_tlogger * Add ban_addr_tlogger_init() * Invoke it before the first call to ban_addr() * maple/bbsd.c main()
- Loading branch information