From fe4231b1dbb41f9eced8005b2e46453a81f08fa9 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 9 Jun 2020 19:48:35 +0200 Subject: Make sure to send update messages for all create messages that was originally the result of a move message. --- src/messageparser.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/messageparser.h') diff --git a/src/messageparser.h b/src/messageparser.h index 85ce5cf..218f3a8 100644 --- a/src/messageparser.h +++ b/src/messageparser.h @@ -30,14 +30,25 @@ #include "message.h" #include +#include MessageList parse_msg(std::string msg); MessageList parse_msg_client(std::string msg); //message_t create_msg(cmd::cmd_t type, node_t node); -std::string msg_tostring(message_t msg); + +//! Create a (list of) string(s) from a single message. +//! Only the create_with_attributes message type produces more than one item in +//! the list, namely the create message and update messages for each attribute +//! in the node. +std::vector msg_tostring(message_t msg); message_t create_msg_create(node_t node, nodeid_t insertbeforeid); + +//! Same as create_msg_create, but with a different type. +message_t create_msg_create_with_attributes(node_t node, + nodeid_t insertbeforeid); + message_t create_msg_update(node_t node, const std::string &attr); message_t create_msg_remove(node_t node); message_t create_msg_move(nodeid_t id, nodeid_t to, nodeid_t insertbeforeid); -- cgit v1.2.3