From 701c8add0d75f94ca2c34cafa686a54aee5854c6 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 27 Jul 2020 16:02:21 +0200 Subject: Fix docs: 'history' gives messages in chronological order --- db.h | 2 +- protocol.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/db.h b/db.h index 8d618b4..d1c105b 100644 --- a/db.h +++ b/db.h @@ -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: - ` history ` - Response to the client's `history` command; is followed by exactly `` 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). - ` history_message ` - Part of the response to the client's `history` command. Index 0 is the - newest message; index (`` - 1) (from the `history` response) is the - oldest message in the fragment requested. Timestamps are microseconds since + oldest message; index (`` - 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, `` will be at most ``, and may be less if the room does not yet have `` 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`. - ` history_before ` - Same as `history`, except the returned messages are the last `` -- cgit v1.2.3-70-g09d2