summaryrefslogtreecommitdiffstats
path: root/mbbsd/talk.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-04 17:48:27 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-04 17:48:27 +0800
commit431ac04533837d4d6bf8d01314f5c3e794e4a2a6 (patch)
treeea809f1e6a3bfe56fbc4f25d732231e1a6377c81 /mbbsd/talk.c
parent911a0f4f78bf10384e32bd96cc2a2742b7005d94 (diff)
downloadpttbbs-outtacache.tar
pttbbs-outtacache.tar.gz
pttbbs-outtacache.tar.bz2
pttbbs-outtacache.tar.lz
pttbbs-outtacache.tar.xz
pttbbs-outtacache.tar.zst
pttbbs-outtacache.zip
completeouttacache
git-svn-id: http://opensvn.csie.org/pttbbs/branches/outtacache@1687 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/talk.c')
-rw-r--r--mbbsd/talk.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index b801357b..604f3de8 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -210,20 +210,27 @@ 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, OUTTACACHEPOST)) > 0 ){
+ 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);
}
@@ -242,7 +249,7 @@ login_friend_online(void)
}
}
}
- return 0;
+ return;
}
int