xC/xP: send buffer type and server state

Also make PM highlighting behaviour consistent.
This commit is contained in:
2022-09-11 20:46:35 +02:00
parent 1493d9998b
commit 96fc12bc4c
4 changed files with 201 additions and 35 deletions

View File

@@ -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: