summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/munia_proto.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/munia_proto.cc b/src/munia_proto.cc
index dfc70d2..ef572e8 100644
--- a/src/munia_proto.cc
+++ b/src/munia_proto.cc
@@ -32,8 +32,9 @@
#include <queue>
#include <map>
+#include <cassert>
-#include "hugin.hpp"
+#include <hugin.hpp>
#include "node.h"
#include "messageparser.h"
@@ -231,6 +232,12 @@ int callback_lws_node(struct lws *wsi,
node_t node = node_manager.node(*id);
message_t createmsg = create_msg_create(node, -1);
+ if(id == ids.begin())
+ {
+ assert(createmsg.cmd == cmd::create); // First message must always be a create of the root node
+ // Force the first node to have parent -1
+ createmsg.create.parentid = -1;
+ }
createmsg.tid = omi->subscribe.id;
msgqueue[wsi].push_back(createmsg);