diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2013-09-24 12:12:42 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2013-09-24 12:12:42 +0800 |
commit | 547b65f1a36e9fe163a41d600477d9c964ab3042 (patch) | |
tree | bb272c248afa51e00c0d4e250f69e18f26c575ba | |
parent | 227071ffb7d2e1090f625954606d8757b2abbb07 (diff) | |
download | pttbbs-547b65f1a36e9fe163a41d600477d9c964ab3042.tar pttbbs-547b65f1a36e9fe163a41d600477d9c964ab3042.tar.gz pttbbs-547b65f1a36e9fe163a41d600477d9c964ab3042.tar.bz2 pttbbs-547b65f1a36e9fe163a41d600477d9c964ab3042.tar.lz pttbbs-547b65f1a36e9fe163a41d600477d9c964ab3042.tar.xz pttbbs-547b65f1a36e9fe163a41d600477d9c964ab3042.tar.zst pttbbs-547b65f1a36e9fe163a41d600477d9c964ab3042.zip |
Fix "broadcast" in user-talk. #1IGF21HD (PttSuggest) [ptt.cc]
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5878 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/talk.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/pttbbs/mbbsd/talk.c b/pttbbs/mbbsd/talk.c index 53308fc7..cb2e5e26 100644 --- a/pttbbs/mbbsd/talk.c +++ b/pttbbs/mbbsd/talk.c @@ -2450,19 +2450,29 @@ userlist(void) for (i = 0; currutmp->friend_online[i] && i < MAX_FRIEND; ++i) { where = currutmp->friend_online[i] & 0xFFFFFF; - if (VALID_USHM_ENTRY(where) && - (uentp = &SHM->uinfo[where]) && - uentp->pid && - isvisible_stat(currutmp, uentp, - frstate = - currutmp->friend_online[i] >> 24) - && kill(uentp->pid, 0) != -1 && - uentp->pager != PAGER_ANTIWB && - (uentp->pager != PAGER_FRIENDONLY || frstate & HFM) && - !(frstate & IRH)) { - my_write(uentp->pid, genbuf, uentp->userid, - WATERBALL_PREEDIT, NULL); - } + if (!VALID_USHM_ENTRY(where)) + continue; + uentp = &SHM->uinfo[where]; + if (!uentp || !uentp->pid) + continue; + frstate = currutmp->friend_online[i] >> 24; + // Only to people who I've friended him. + if (!(frstate & IFH)) + continue; + if (!isvisible_stat(currutmp, uentp, frstate)) + continue; + if (uentp->pager == PAGER_ANTIWB) + continue; + if (uentp->pager == PAGER_FRIENDONLY && + !(frstate & HFM)) + continue; + // HRM + HFM = super friend. + if ((frstate & HRM) && !(frstate & HFM)) + continue; + if (kill(uentp->pid, 0) == -1) + continue; + my_write(uentp->pid, genbuf, uentp->userid, + WATERBALL_PREEDIT, NULL); } } redrawall = redraw = 1; |