diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2010-07-12 12:06:01 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2010-07-12 12:06:01 +0800 |
commit | 4901fcb82cd76ed92a7c88f9b7d8fbbc1c9f6cee (patch) | |
tree | c707f35a963cb742ce21b1d17e7777040e994245 | |
parent | e00fcc46889895a6719104c48753a2bc52b04717 (diff) | |
download | pttbbs-4901fcb82cd76ed92a7c88f9b7d8fbbc1c9f6cee.tar pttbbs-4901fcb82cd76ed92a7c88f9b7d8fbbc1c9f6cee.tar.gz pttbbs-4901fcb82cd76ed92a7c88f9b7d8fbbc1c9f6cee.tar.bz2 pttbbs-4901fcb82cd76ed92a7c88f9b7d8fbbc1c9f6cee.tar.lz pttbbs-4901fcb82cd76ed92a7c88f9b7d8fbbc1c9f6cee.tar.xz pttbbs-4901fcb82cd76ed92a7c88f9b7d8fbbc1c9f6cee.tar.zst pttbbs-4901fcb82cd76ed92a7c88f9b7d8fbbc1c9f6cee.zip |
* fix admin_give_money notification
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5086 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/admin.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/pttbbs/mbbsd/admin.c b/pttbbs/mbbsd/admin.c index 96e3f96d..965933ef 100644 --- a/pttbbs/mbbsd/admin.c +++ b/pttbbs/mbbsd/admin.c @@ -1098,12 +1098,16 @@ int make_symbolic_link_interactively(int gid) } static void -give_id_money(const char *user_id, int money, const char *mail_title) +adm_give_id_money(const char *user_id, int money, const char *mail_title) { char tt[TTLEN + 1] = {0}; int unum = searchuser(user_id, NULL); - if (unum <= 0 || pay_as_uid(unum, -money, "站長發紅包") < 1) { + // XXX 站長們似乎利用這個功能來同時發錢或扣錢,所以唯一 failure 的 case + // 是 return == -1 (若 0 代表對方錢被扣光) + if (unum <= 0 || pay_as_uid(unum, -money, "站長%s: %s", + money >= 0 ? "發紅包" : "扣錢", + mail_title) == -1) { move(12, 0); clrtoeol(); prints("id:%s money:%d 不對吧!!", user_id, money); @@ -1173,7 +1177,7 @@ give_money(void) if (bad_user_id(SHM->userid[i])) continue; id = SHM->userid[i]; - give_id_money(id, money, tt); + adm_give_id_money(id, money, tt); fprintf(fp2,"給 %s : %d\n", id, money); count++; } @@ -1192,7 +1196,7 @@ give_money(void) id = buf; mn = ptr + 1; money = atoi(mn); - give_id_money(id, money, tt); + adm_give_id_money(id, money, tt); fprintf(fp2,"給 %s : %d\n", id, money); total_money += money; count++; |