Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit eee9b4c1 authored by Marten Gajda's avatar Marten Gajda Committed by GitHub
Browse files

Update Notification when task is updated, fixes #115 (#803)

parent e870f6f3
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -135,18 +135,18 @@ public class TaskNotificationService extends JobIntentService
                    {
                        if (diff.left().value().taskVersion() != diff.right().value().taskVersion())
                        {
                            /*
                             * The task has been modified. If it's pinned we update it.
                             * Otherwise we remove it if it was pinned before.
                             */
                            if (diff.right().value().ongoing())
                            if (diff.left().value().ongoing() && !diff.right().value().ongoing())
                            {
                                ActionService.startAction(this, ActionService.ACTION_RENOTIFY, diff.left().value().task());
                                // task has been unpinned, remove the notification
                                removeTaskNotification(diff.left().value().task());
                            }
                            else if (diff.left().value().ongoing())
                            else
                            {
                                // task has been unpinned
                                removeTaskNotification(diff.left().value().task());
                                // task was updated, also update the notification
                                // TODO: if the original reason for the notification is no longer true, remove the notification.
                                // example: the due date of a task with a due notification is moved to the future
                                // see https://github.com/dmfs/opentasks/issues/400
                                ActionService.startAction(this, ActionService.ACTION_RENOTIFY, diff.left().value().task());
                            }
                        }
                    }