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.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/munia_proto.cc b/src/munia_proto.cc
index 6a165db..977bf60 100644
--- a/src/munia_proto.cc
+++ b/src/munia_proto.cc
@@ -33,7 +33,7 @@
#include <queue>
#include <map>
-#include "debug.h"
+#include "hugin.hpp"
#include "task.h"
#include "messageparser.h"
@@ -94,7 +94,7 @@ int callback_lws_task(struct libwebsocket_context * context,
{
task_manager.tree.toStdOut();
- printf("Callback on %p\n", wsi);
+ DEBUG(proto, "Callback on %p\n", wsi);
switch (reason) {
case LWS_CALLBACK_ESTABLISHED:
@@ -187,7 +187,7 @@ int callback_lws_task(struct libwebsocket_context * context,
current_client = wsi;
- printf("%s\n", (char*)in);
+ DEBUG(proto, "%s\n", (char*)in);
std::string data;
data.append((char*)in, len);
@@ -215,11 +215,16 @@ int callback_lws_task(struct libwebsocket_context * context,
message_t createmsg = create_msg_create(task);
createmsg.tid = omi->observe.id;
- message_t updatemsg = create_msg_update(task);
- updatemsg.tid = omi->observe.id;
-
msgqueue[wsi].push_back(createmsg);
- msgqueue[wsi].push_back(updatemsg);
+
+ std::map<std::string, std::string>::iterator ai =
+ task.attributes.begin();
+ while(ai != task.attributes.end()) {
+ message_t updatemsg = create_msg_update(task, ai->first);
+ updatemsg.tid = omi->observe.id;
+ msgqueue[wsi].push_back(updatemsg);
+ ai++;
+ }
id++;
}