From 4ba28c6ed3b952a06aba8ae96220c429d4d02365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Wed, 7 Sep 2022 19:42:18 +0200 Subject: xC/xP: mark highlights and buffer activity And more or less finalize out the protocol for this use case. --- xC-proto | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'xC-proto') diff --git a/xC-proto b/xC-proto index d25a118..46955e7 100644 --- a/xC-proto +++ b/xC-proto @@ -3,6 +3,8 @@ const VERSION = 1; // From the frontend to the relay. struct CommandMessage { + // The command sequence number will be repeated in responses + // in the respective fields. u32 command_seq; union CommandData switch (enum Command { HELLO, @@ -15,6 +17,9 @@ struct CommandMessage { } command) { case HELLO: u32 version; + // If the version check succeeds, the client will receive + // an initial stream of BUFFER_UPDATE, BUFFER_LINE, + // and finally a BUFFER_ACTIVATE message. case PING: void; case ACTIVE: @@ -51,6 +56,15 @@ struct EventMessage { void; case BUFFER_UPDATE: string buffer_name; + // These are cumulative, even for lines flushed out from buffers. + // Updates to these values aren't broadcasted, thus handle: + // - BUFFER_LINE by bumping/setting them as appropriate, + // - BUFFER_ACTIVATE by clearing them for the previous buffer + // (this way, they can be used to mark unread messages). + // Any updates received after the initial sync should be ignored. + u32 new_messages; + u32 new_unimportant_messages; + bool highlighted; case BUFFER_RENAME: string buffer_name; string new; @@ -60,6 +74,7 @@ struct EventMessage { string buffer_name; case BUFFER_LINE: string buffer_name; + // Whether the line should also be displayed in the active buffer. bool leak_to_active; bool is_unimportant; bool is_highlight; @@ -106,7 +121,8 @@ struct EventMessage { case BUFFER_CLEAR: string buffer_name; - // Restriction: command_seq is strictly increasing, across both of these. + // Restriction: command_seq strictly follows the sequence received + // by the relay, across both of these replies. case ERROR: u32 command_seq; string error; -- cgit v1.2.3