From 547b65f1a36e9fe163a41d600477d9c964ab3042 Mon Sep 17 00:00:00 2001 From: piaip Date: Tue, 24 Sep 2013 04:12:42 +0000 Subject: Fix "broadcast" in user-talk. #1IGF21HD (PttSuggest) [ptt.cc] git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5878 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/mbbsd/talk.c | 36 +++++++++++++++++++++++------------- 1 file 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; -- cgit v1.2.3