diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-11-28 23:38:47 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-11-28 23:38:47 +0800 |
commit | 646b9bc9bb80834854e1fa4e92b0fc9ecf6a804d (patch) | |
tree | c44621a037ae23d1e2a6406432b4eaa74fadcbc7 | |
parent | d08fb45c9f99cb4eb4a91629a16b7c1e0a0decc8 (diff) | |
download | pttbbs-646b9bc9bb80834854e1fa4e92b0fc9ecf6a804d.tar pttbbs-646b9bc9bb80834854e1fa4e92b0fc9ecf6a804d.tar.gz pttbbs-646b9bc9bb80834854e1fa4e92b0fc9ecf6a804d.tar.bz2 pttbbs-646b9bc9bb80834854e1fa4e92b0fc9ecf6a804d.tar.lz pttbbs-646b9bc9bb80834854e1fa4e92b0fc9ecf6a804d.tar.xz pttbbs-646b9bc9bb80834854e1fa4e92b0fc9ecf6a804d.tar.zst pttbbs-646b9bc9bb80834854e1fa4e92b0fc9ecf6a804d.zip |
Change 'list' to online list (let client decide).
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5722 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/daemon/angelbeats/abc.c | 4 | ||||
-rw-r--r-- | pttbbs/daemon/angelbeats/angelbeats.c | 11 | ||||
-rw-r--r-- | pttbbs/include/daemons.h | 2 | ||||
-rw-r--r-- | pttbbs/mbbsd/angel.c | 2 |
4 files changed, 9 insertions, 10 deletions
diff --git a/pttbbs/daemon/angelbeats/abc.c b/pttbbs/daemon/angelbeats/abc.c index f3fc2636..8420318e 100644 --- a/pttbbs/daemon/angelbeats/abc.c +++ b/pttbbs/daemon/angelbeats/abc.c @@ -63,7 +63,7 @@ int main(int argc, char *argv[]) return -1; } } else if (strcmp(argv[1], "list") == 0) { - req.operation = ANGELBEATS_REQ_GET_UID_LIST; + req.operation = ANGELBEATS_REQ_GET_ONLINE_LIST; } else return 0; @@ -99,7 +99,7 @@ int main(int argc, char *argv[]) rpt.my_index, rpt.my_active_index, rpt.my_active_masters); - } else if (req.operation == ANGELBEATS_REQ_GET_UID_LIST) { + } else if (req.operation == ANGELBEATS_REQ_GET_ONLINE_LIST) { int i; if (toread(fd, &list, sizeof(list)) != sizeof(list)) { perror("toread"); diff --git a/pttbbs/daemon/angelbeats/angelbeats.c b/pttbbs/daemon/angelbeats/angelbeats.c index 512064c3..bbb91cc8 100644 --- a/pttbbs/daemon/angelbeats/angelbeats.c +++ b/pttbbs/daemon/angelbeats/angelbeats.c @@ -371,7 +371,7 @@ create_angel_report(int myuid, angel_beats_report *prpt) { } int -fill_angel_uid_list(angel_beats_uid_list *list) { +fill_online_angel_list(angel_beats_uid_list *list) { static size_t i = 0; size_t iter = 0; int is_pause, logins; @@ -384,8 +384,7 @@ fill_angel_uid_list(angel_beats_uid_list *list) { i %= g_angel_list_size; kanade = g_angel_list + i; get_angel_state(kanade, &is_pause, &logins); - // TODO Let client handle case of "pause". - if (!logins || is_pause) + if (!logins) continue; list->uids[list->angels++] = kanade->uid; } @@ -481,13 +480,13 @@ client_cb(int fd, short event, void *arg) { goto end; } break; - case ANGELBEATS_REQ_GET_UID_LIST: - fprintf(stderr, "%s get_uid_list\n", Cdatelite(&clk)); + case ANGELBEATS_REQ_GET_ONLINE_LIST: + fprintf(stderr, "%s get_online_uid_list\n", Cdatelite(&clk)); { angel_beats_uid_list list = {0}; list.cb = sizeof(list); list.angels = 0; - fill_angel_uid_list(&list); + fill_online_angel_list(&list); // write different kind of data! write(fd, &list, sizeof(list)); goto end; diff --git a/pttbbs/include/daemons.h b/pttbbs/include/daemons.h index 83f0d95e..f670644b 100644 --- a/pttbbs/include/daemons.h +++ b/pttbbs/include/daemons.h @@ -67,7 +67,7 @@ enum ANGELBEATS_OPERATIONS { ANGELBEATS_REQ_SUGGEST_AND_LINK, ANGELBEATS_REQ_REMOVE_LINK, ANGELBEATS_REQ_HEARTBEAT, - ANGELBEATS_REQ_GET_UID_LIST, + ANGELBEATS_REQ_GET_ONLINE_LIST, }; typedef struct { diff --git a/pttbbs/mbbsd/angel.c b/pttbbs/mbbsd/angel.c index 85ec0314..79700da7 100644 --- a/pttbbs/mbbsd/angel.c +++ b/pttbbs/mbbsd/angel.c @@ -207,7 +207,7 @@ select_angel() { } req.cb = sizeof(req); - req.operation = ANGELBEATS_REQ_GET_UID_LIST; + req.operation = ANGELBEATS_REQ_GET_ONLINE_LIST; req.master_uid = usernum; if (towrite(fd, &req, sizeof(req)) < 0 || |