summaryrefslogtreecommitdiff
path: root/src/messagehandler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/messagehandler.cc')
-rw-r--r--src/messagehandler.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/messagehandler.cc b/src/messagehandler.cc
index 3065e60..0d2dd3c 100644
--- a/src/messagehandler.cc
+++ b/src/messagehandler.cc
@@ -44,31 +44,29 @@ MessageList handle_msg(MessageList msgList, clientid_t wsi) {
message_t &m = *it;
switch(m.cmd) {
- case cmd::add:
+ case cmd::create:
{
- INFO(messagehandler, "Handling add command\n");
+ INFO(messagehandler, "Handling create command\n");
task_t t = task_manager.createTask();
- t.title = m.add.title;
- t.desc = m.add.desc;
try {
- m.nodes = task_manager.addTask(t, m.add.parentid);
+ m.nodes = task_manager.addTask(t, m.create.parentid);
outmsgs.push_back(m);
}
catch (std::exception& e) {
- DEBUG(messagehandler, "Error adding task\n");
+ DEBUG(messagehandler, "Error creating task\n");
}
}
break;
- case cmd::del:
+ case cmd::remove:
{
- INFO(messagehandler, "Handling del command\n");
+ INFO(messagehandler, "Handling remove command\n");
try {
- m.nodes = task_manager.deleteTask(m.del.id);
+ m.nodes = task_manager.deleteTask(m.remove.id);
outmsgs.push_back(m);
}
catch (std::exception& e) {
- DEBUG(messagehandler, "Error deleting task\n");
+ DEBUG(messagehandler, "Error remove task\n");
}
}
break;
@@ -104,7 +102,6 @@ MessageList handle_msg(MessageList msgList, clientid_t wsi) {
try {
task_t t;
t.title = m.update.title;
- t.desc = m.update.desc;
m.nodes = task_manager.updateTask(m.update.id, t);
outmsgs.push_back(m);
}