avoid removal of recurrent task due to TW-638 bug of taskwarrior
[ptask.git] / src / tw.c
index 5ec2bc4..3049c0b 100644 (file)
--- a/src/tw.c
+++ b/src/tw.c
@@ -108,7 +108,9 @@ static int task_check_version()
 
        log_debug("task version: %s", ver);
 
-       if (!strcmp(ver, "2.2.0") || !strcmp(ver, "2.0.0"))
+       if (!strcmp(ver, "2.2.0")
+           || !strcmp(ver, "2.0.0")
+           || !strcmp(ver, "2.3.0"))
                return 1;
        else
                return 0;
@@ -238,6 +240,12 @@ struct task **tw_get_all_tasks(const char *status)
                                = parse_time(json_object_get_string(json));
                else
                        tasks[i]->start = NULL;
+
+               json = json_object_object_get(jtask, "recur");
+               if (json)
+                       tasks[i]->recur = strdup(json_object_get_string(json));
+               else
+                       tasks[i]->recur = NULL;
        }
 
        tasks[n] = NULL;
@@ -459,6 +467,7 @@ static void task_free(struct task *task)
        free(task->entry);
        free(task->due);
        free(task->start);
+       free(task->recur);
 
        free(task);
 }