summaryrefslogtreecommitdiff
path: root/src/munia_proto.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/munia_proto.cc')
-rw-r--r--src/munia_proto.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/munia_proto.cc b/src/munia_proto.cc
index 33de8a3..dfc70d2 100644
--- a/src/munia_proto.cc
+++ b/src/munia_proto.cc
@@ -141,10 +141,12 @@ int callback_lws_node(struct lws *wsi,
{
nodeid_t id = j->create.id;
nodeid_t parentid = j->create.parentid;
+ nodeid_t insertbeforeid = j->create.insertbeforeid;
msgqueue[wsi].erase(j); // erase create msg
msg.cmd = cmd::move;
msg.move.id = id;
msg.move.parentid = parentid;
+ msg.move.insertbeforeid = insertbeforeid;
}
}
i++;
@@ -159,13 +161,11 @@ int callback_lws_node(struct lws *wsi,
{
message_t msg = msgqueue[wsi].front();
msgqueue[wsi].pop_front();
- char buf[32];
- sprintf(buf, "%d", msg.tid);
if(msgstr.size() > LWS_SEND_BUFFER_PRE_PADDING)
{
msgstr += " ";
}
- msgstr += std::string(buf) + " " + msg_tostring(msg);
+ msgstr += std::to_string(msg.tid) + " " + msg_tostring(msg);
}
msgstr.append((size_t)LWS_SEND_BUFFER_POST_PADDING, ' ');
@@ -221,7 +221,7 @@ int callback_lws_node(struct lws *wsi,
}
catch(...)
{
- DEBUG(proto, "No such node %d\n", omi->subscribe.id);
+ DEBUG(proto, "No such node %d\n", (int)omi->subscribe.id);
omi++;
continue;
}
@@ -230,7 +230,7 @@ int callback_lws_node(struct lws *wsi,
{
node_t node = node_manager.node(*id);
- message_t createmsg = create_msg_create(node);
+ message_t createmsg = create_msg_create(node, -1);
createmsg.tid = omi->subscribe.id;
msgqueue[wsi].push_back(createmsg);
@@ -258,7 +258,7 @@ int callback_lws_node(struct lws *wsi,
}
catch(...)
{
- DEBUG(proto, "No such node %d\n", omi->unsubscribe.id);
+ DEBUG(proto, "No such node %d\n", (int)omi->unsubscribe.id);
omi++;
continue;
}
@@ -270,7 +270,7 @@ int callback_lws_node(struct lws *wsi,
message_t removemsg = create_msg_remove(node);
removemsg.tid = omi->unsubscribe.id;
msgqueue[wsi].push_back(removemsg);
- DEBUG(unsubscribe, "remove id: %d\n", *id);
+ DEBUG(unsubscribe, "remove id: %d\n", (int)*id);
id++;
}
@@ -290,7 +290,7 @@ int callback_lws_node(struct lws *wsi,
clientid_t clientid = (*ci).first;
nodeid_t tid = (*ci).second;
- DEBUG(proto, "Subscriber id of node: %d\n", tid);
+ DEBUG(proto, "Subscriber id of node: %d\n", (int)tid);
message_t msg = *omi;
msg.tid = tid;