summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Suhr Christensen <jsc@umbraculum.org>2012-05-04 15:47:01 +0200
committerJonas Suhr Christensen <jsc@umbraculum.org>2012-05-04 15:47:01 +0200
commita48a2489f531e36947c8d6f56dd2896dbf1dbf65 (patch)
tree81dc7a7b06375a802430b92e66cc6692d216693b /src
parentaba669e10fada5a4e18ee550e9505e622287797f (diff)
parent6f6bd04d77336927f344b1fd4b02880286aebdcb (diff)
Merge branch 'master' of https://git.oftal.dk/munia
Diffstat (limited to 'src')
-rw-r--r--src/messagehandler.cc4
-rw-r--r--src/taskmanager.cc3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/messagehandler.cc b/src/messagehandler.cc
index 0b63da1..8217bde 100644
--- a/src/messagehandler.cc
+++ b/src/messagehandler.cc
@@ -48,7 +48,9 @@ MessageList handle_msg(MessageList msgList, clientid_t wsi) {
{
INFO(messagehandler, "Handling create command\n");
try {
- m.nodes = task_manager.createTask(m.create.parentid);
+ taskid_t id;
+ m.nodes = task_manager.createTask(m.create.parentid, &id);
+ m.create.id = id;
outmsgs.push_back(m);
}
catch (std::exception& e) {
diff --git a/src/taskmanager.cc b/src/taskmanager.cc
index cf7defc..2dda0e0 100644
--- a/src/taskmanager.cc
+++ b/src/taskmanager.cc
@@ -120,7 +120,7 @@ TaskIdList TaskManager::updateTask(taskid_t id, task_t t)
return affectedTasks;
}
-TaskIdList TaskManager::createTask(taskid_t parentid)
+TaskIdList TaskManager::createTask(taskid_t parentid, taskid_t *pid)
throw (std::exception) {
TaskIdList affectedTasks;
@@ -128,6 +128,7 @@ TaskIdList TaskManager::createTask(taskid_t parentid)
taskid_t id = createId();
t.title = "";
t.id = id;
+ if(pid) *pid = id;
try {
affectedTasks = tree.insertAsChild(parentid, id, t);