From 8803632a5f9e36cc9a82b42bdc60280fc22a0270 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 10 Feb 2021 10:15:24 +0100 Subject: protocol: Clarify timestamps --- protocol.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/protocol.md b/protocol.md index 549ac01..5951f11 100644 --- a/protocol.md +++ b/protocol.md @@ -17,6 +17,10 @@ Preliminary definitions: - A _word_ is a string without spaces (ASCII 32) (and also without newlines). Note that the empty string is also a valid word. +Timestamps in the protocol, which indicate the time at which an event happened, +are represented as microseconds since the UNIX epoch. A valid timestamp is +always non-negative, i.e. at least 0. + There are three kinds of messages: commands from the client, command responses from the server, and push messages from the server (not to be confused with push _notifications_). These three kinds are described below. @@ -64,10 +68,9 @@ A _response_ from the server will be in one of the following forms: - ` history_message ` - Part of the response to the client's `history` command. Index 0 is the oldest message; index (`` - 1) (from the `history` response) is the - newest message in the fragment requested. Timestamps are microseconds since - the UNIX epoch. The reply message id is -1 if the message is a normal - message, or nonnegative if it is a reply to the referenced message in the - same room. + newest message in the fragment requested. The reply message id is -1 if the + message is a normal message, or nonnegative if it is a reply to the + referenced message in the same room. - ` message ` - Response to the client's `get_message` command. This contains the information for a single message, as in `_push message` and the -- cgit v1.2.3-70-g09d2