From 96fc12bc4c852f1343a120126f1f46ac7cca447d Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Sun, 11 Sep 2022 20:46:35 +0200 Subject: xC/xP: send buffer type and server state Also make PM highlighting behaviour consistent. --- xC-proto | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'xC-proto') diff --git a/xC-proto b/xC-proto index 52bab54..819eb24 100644 --- a/xC-proto +++ b/xC-proto @@ -19,8 +19,8 @@ struct CommandMessage { case HELLO: u32 version; // If the version check succeeds, the client will receive - // an initial stream of BUFFER_UPDATE, BUFFER_STATS, BUFFER_LINE, - // and finally a BUFFER_ACTIVATE message. + // an initial stream of SERVER_UPDATE, BUFFER_UPDATE, BUFFER_STATS, + // BUFFER_LINE, and finally a BUFFER_ACTIVATE message. case ACTIVE: void; case BUFFER_INPUT: @@ -56,14 +56,33 @@ struct EventMessage { BUFFER_ACTIVATE, BUFFER_LINE, BUFFER_CLEAR, + SERVER_UPDATE, + SERVER_RENAME, + SERVER_REMOVE, ERROR, RESPONSE, } event) { case PING: void; + case BUFFER_UPDATE: string buffer_name; bool hide_unimportant; + union BufferContext switch (enum BufferKind { + GLOBAL, + SERVER, + CHANNEL, + PRIVATE_MESSAGE, + } kind) { + case GLOBAL: + void; + case SERVER: + string server_name; + case CHANNEL: + string server_name; + case PRIVATE_MESSAGE: + string server_name; + } context; case BUFFER_STATS: string buffer_name; // These are cumulative, even for lines flushed out from buffers. @@ -130,6 +149,23 @@ struct EventMessage { case BUFFER_CLEAR: string buffer_name; + case SERVER_UPDATE: + string server_name; + enum ServerState { + DISCONNECTED, + CONNECTING, + CONNECTED, + REGISTERED, + DISCONNECTING, + } state; + case SERVER_RENAME: + // Buffers aren't sent updates for in this circumstance, + // as that wouldn't be sufficiently atomic anyway. + string server_name; + string new; + case SERVER_REMOVE: + string server_name; + // Restriction: command_seq strictly follows the sequence received // by the relay, across both of these replies. case ERROR: -- cgit v1.2.3-70-g09d2