summaryrefslogtreecommitdiffstats
path: root/mbbsd/talk.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-02 03:42:01 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-02 03:42:01 +0800
commit5cbf0eb30d065989bfd5eacb06edbd2501ee6e80 (patch)
tree7cf666bfc2c79b5a388df4dd48a6727b3e1da382 /mbbsd/talk.c
parent2da9854fc5e25207038df1245012a33710dd42b7 (diff)
downloadpttbbs-5cbf0eb30d065989bfd5eacb06edbd2501ee6e80.tar
pttbbs-5cbf0eb30d065989bfd5eacb06edbd2501ee6e80.tar.gz
pttbbs-5cbf0eb30d065989bfd5eacb06edbd2501ee6e80.tar.bz2
pttbbs-5cbf0eb30d065989bfd5eacb06edbd2501ee6e80.tar.lz
pttbbs-5cbf0eb30d065989bfd5eacb06edbd2501ee6e80.tar.xz
pttbbs-5cbf0eb30d065989bfd5eacb06edbd2501ee6e80.tar.zst
pttbbs-5cbf0eb30d065989bfd5eacb06edbd2501ee6e80.zip
- angel: add Ctrl-P in userlist to toggle angel_pause.
- angel: setting angel_pause now takes effects immediately. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4062 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/talk.c')
-rw-r--r--mbbsd/talk.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index ccbf7be2..1b7f0da5 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -854,10 +854,12 @@ my_write(pid_t pid, const char *prompt, const char *id, int flag, userinfo_t * p
if (!uin || !*uin->userid || (strcasecmp(destid, uin->userid)
#ifdef PLAY_ANGEL
&& flag != WATERBALL_ANGEL && flag != WATERBALL_CONFIRM_ANGEL) ||
+ // check if user is changed of angelpause.
((flag == WATERBALL_ANGEL || flag == WATERBALL_CONFIRM_ANGEL)
- && strcasecmp(cuser.myangel, uin->userid)
+ && (strcasecmp(cuser.myangel, uin->userid) || uin->angelpause)
#endif
)) {
+ bell();
vmsg("糟糕! 對方已落跑了(不在站上)! ");
currutmp->chatid[0] = c0;
currutmp->mode = mode0;
@@ -2988,6 +2990,19 @@ userlist(void)
}
break;
+#ifdef PLAY_ANGEL
+ case Ctrl('P'):
+ if (HasUserPerm(PERM_ANGEL) && currutmp) {
+ currutmp->angelpause = !currutmp->angelpause;
+ bell();
+ vmsg(currutmp->angelpause ?
+ " 停止接受小主人的問題 | X | " :
+ " 開始接受小主人發問 | ● | ");
+ redrawall = redraw = 1;
+ }
+ break;
+#endif // PLAY_ANGLE
+
case Ctrl('W'):
if (HasUserPerm(PERM_LOGINOK)) {
int tmp;
@@ -3536,6 +3551,9 @@ static inline void
AngelNotOnline(){
char buf[PATHLEN] = "";
const static char* const not_online_message = "您的小天使現在不在線上";
+
+ // TODO cache angel's nick name!
+
if (cuser.myangel[0] != '-')
sethomefile(buf, cuser.myangel, "angelmsg");
if (cuser.myangel[0] == '-' || !dashf(buf))