diff options
Diffstat (limited to 'mbbsd/talk.c')
-rw-r--r-- | mbbsd/talk.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 8052ae5a..23a5a305 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -210,12 +210,31 @@ reverse_friend_stat(int stat) return stat1; } -int -login_friend_online(void) +void login_friend_online(void) { userinfo_t *uentp; int i, stat, stat1; int offset = (int)(currutmp - &SHM->uinfo[0]); +#ifdef OUTTACACHE + int sfd; + if( (sfd = toconnect(OUTTACACHEHOST, OUTTACACHEPORT)) > 0 ){ + if( towrite(sfd, &offset, sizeof(offset)) > 0 && + towrite(sfd, &currutmp->uid, sizeof(currutmp->uid)) > 0 && + towrite(sfd, currutmp->friend, sizeof(currutmp->friend)) > 0 && + towrite(sfd, currutmp->reject, sizeof(currutmp->reject)) > 0 ){ + ocfs_t fs; + while( toread(sfd, &fs, sizeof(fs)) > 0 ) + if( SHM->uinfo[fs.index].uid == fs.uid ){ + currutmp->friend_online[currutmp->friendtotal++] + = fs.friendstat; + SHM->uinfo[fs.index].friend_online[ SHM->uinfo[fs.index].friendtotal++ ] = fs.rfriendstat; + } + close(sfd); + return; + } + close(sfd); + } +#endif for (i = 0; i < SHM->UTMPnumber && currutmp->friendtotal < MAX_FRIEND; i++) { uentp = (SHM->sorted[SHM->currsorted][0][i]); if (uentp && uentp->uid && (stat = set_friend_bit(currutmp, uentp))) { @@ -230,7 +249,7 @@ login_friend_online(void) } } } - return 0; + return; } int |