diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2020-07-27 16:02:21 +0200 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2020-07-27 16:02:21 +0200 |
commit | 701c8add0d75f94ca2c34cafa686a54aee5854c6 (patch) | |
tree | 2acd3ded3c34ee3d098bf882336c998de811e547 | |
parent | 947dd507870976ad5fb29d76da7689cf88170cb0 (diff) |
Fix docs: 'history' gives messages in chronological order
-rw-r--r-- | db.h | 2 | ||||
-rw-r--r-- | protocol.md | 8 |
2 files changed, 5 insertions, 5 deletions
@@ -60,7 +60,7 @@ bool db_add_token(i64 userid,const char *token); bool db_delete_token(i64 userid,const char *token); i64 db_create_message(i64 roomid,i64 userid,i64 timestamp,const char *message); // returns msgid -struct db_message_list db_get_messages(i64 roomid,i64 count); // gets latest `count` messages +struct db_message_list db_get_messages(i64 roomid,i64 count); // gets latest `count` messages in rev. chron. order // if beforeid<0, same as db_get_messages struct db_message_list db_get_messages_before(i64 roomid,i64 count,i64 beforeid); diff --git a/protocol.md b/protocol.md index 346bfe4..ac8d86a 100644 --- a/protocol.md +++ b/protocol.md @@ -55,11 +55,11 @@ A _response_ from the server will be in one of the following forms: - `<tag> history <count:i64>` - Response to the client's `history` command; is followed by exactly `<count>` messages of type `history_message` with the same tag. The messages are - returned in reverse chronological order (newest first). + returned in chronological order (oldest first). - `<tag> history_message <index:i64> <roomname:word> <user:word> <timestamp:i64> <msgid:i64> <message:string...>` - Part of the response to the client's `history` command. Index 0 is the - newest message; index (`<count>` - 1) (from the `history` response) is the - oldest message in the fragment requested. Timestamps are microseconds since + oldest message; index (`<count>` - 1) (from the `history` response) is the + newest message in the fragment requested. Timestamps are microseconds since the UNIX epoch. The message id for each message is globally unique for the entire server. @@ -136,7 +136,7 @@ ranges until the end of the line). member of the room. In the `history` response, `<count>` will be at most `<number>`, and may be less if the room does not yet have `<number>` messages. Each message will be returned in a `history_message` response - after the `history` response, in reverse chronological order. + after the `history` response, in chronological order. - Returns `history`, followed by zero or more `history_message`. - `<tag> history_before <roomname:word> <number:i64> <msgid:i64>` - Same as `history`, except the returned messages are the last `<number>` |