From c856bb49db4e12106832b0caf3f6d57296744447 Mon Sep 17 00:00:00 2001 From: Tim Su Date: Thu, 20 Jan 2011 23:38:23 -0800 Subject: [PATCH] Fix for AST-325 - reminders pop up even when due dates are changed --- .../com/todoroo/astrid/reminders/Notifications.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java b/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java index 4f3c8221d..39bc10239 100644 --- a/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java +++ b/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java @@ -121,7 +121,7 @@ public class Notifications extends BroadcastReceiver { Task task; try { task = taskDao.fetch(id, Task.ID, Task.TITLE, Task.HIDE_UNTIL, Task.COMPLETION_DATE, - Task.DELETION_DATE, Task.REMINDER_FLAGS); + Task.DUE_DATE, Task.DELETION_DATE, Task.REMINDER_FLAGS); if(task == null) throw new IllegalArgumentException("cound not find item with id"); //$NON-NLS-1$ @@ -138,6 +138,11 @@ public class Notifications extends BroadcastReceiver { if(task.isHidden() && type == ReminderService.TYPE_RANDOM) return true; + // task due date was changed, but alarm wasn't rescheduled + if((type == ReminderService.TYPE_DUE || type == ReminderService.TYPE_OVERDUE) && + !task.hasDueDate() || task.getValue(Task.DUE_DATE) > DateUtilities.now()) + return true; + // read properties String taskTitle = task.getValue(Task.TITLE); boolean nonstopMode = task.getFlag(Task.REMINDER_FLAGS, Task.NOTIFY_NONSTOP);