diff options
Diffstat (limited to 'src/messagehandler.cc')
-rw-r--r-- | src/messagehandler.cc | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/messagehandler.cc b/src/messagehandler.cc index ad9b8bb..5ccf3bf 100644 --- a/src/messagehandler.cc +++ b/src/messagehandler.cc @@ -57,6 +57,14 @@ MessageList handle_msg(MessageList msgList, clientid_t wsi) switch(m.cmd) { + case cmd::login: + // Already handled, before this switch ... case + break; + + case cmd::logout: + connection_handler.logout(wsi); + break; + case cmd::create: { INFO(messagehandler, "Handling create command\n"); @@ -162,17 +170,17 @@ MessageList handle_msg(MessageList msgList, clientid_t wsi) } break; - case cmd::observe: + case cmd::subscribe: { - //connection_handler.observe(wsi, m.observe.id); + //connection_handler.subscribe(wsi, m.subscribe.id); outmsgs.push_back(m); } break; - case cmd::unobserve: - //connection_handler.unobserve(wsi, m.observe.id); + case cmd::unsubscribe: + //connection_handler.unsubscribe(wsi, m.subscribe.id); outmsgs.push_back(m); - DEBUG(handler, "unobserve: %d\n", m.unobserve.id); + DEBUG(handler, "unsubscribe: %d\n", m.unsubscribe.id); break; case cmd::update: @@ -181,7 +189,7 @@ MessageList handle_msg(MessageList msgList, clientid_t wsi) try { m.nodes = task_manager.updateTask(m.update.id, - m.update.name, m.update.value); + m.update.attribute, m.update.value); outmsgs.push_back(m); } catch (std::exception& e) @@ -191,14 +199,6 @@ MessageList handle_msg(MessageList msgList, clientid_t wsi) } break; - case cmd::login: - // Already handled, before this switch ... case - break; - - case cmd::logout: - connection_handler.logout(wsi); - break; - case cmd::error: ERR(messagehandler, "An error occurred.\n"); break; |