From 646c04559e8ddbd3d9d09fdeb0361435c8b8b272 Mon Sep 17 00:00:00 2001 From: scw Date: Sat, 26 Nov 2005 19:28:12 +0000 Subject: Allow banning user from using angel function. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3250 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/talk.c b/mbbsd/talk.c index af9aad56..15165c07 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -3197,11 +3197,14 @@ talkreply(void) int t_changeangel(){ char buf[4]; - if( cuser.myangel[0] == 0 ) return 0; + + /* cuser.myangel == "-" means banned for calling angel */ + if (cuser.myangel[0] == 0 || cuser.myangel[0] == '-') return 0; + getdata(b_lines - 1, 0, "更換小天使後就無法換回了喔! 是否要更換小天使? [y/N]", buf, 3, LCECHO); - if( buf[0] == 'y' || buf[0] == 'Y' ){ + if (buf[0] == 'y' || buf[0] == 'Y') { cuser.myangel[0] = 0; outs("小天使更新完成,下次呼叫時會選出新的小天使"); } @@ -3352,6 +3355,11 @@ TalkToAngel(){ static int AngelPermChecked = 0; userec_t xuser; + if (strcmp(cuser.myangel, "-") == 0){ + AngelNotOnline(); + return; + } + if (cuser.myangel[0] && !AngelPermChecked) { getuser(cuser.myangel, &xuser); // XXX if user doesn't exist if (!(xuser.userlevel & PERM_ANGEL)) -- cgit v1.2.3