Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Export alarm snooze information.
  • Loading branch information
yunosh committed Aug 11, 2017
1 parent 80c387e commit 95cb1c5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions nag/lib/Task.php
Expand Up @@ -1264,6 +1264,16 @@ public function toiCalendar(Horde_Icalendar $calendar)
$vAlarm->setAttribute('TRIGGER;VALUE=DURATION', '-PT' . $this->alarm . 'M');
$vTodo->addComponent($vAlarm);
}
$hordeAlarm = $GLOBALS['injector']->getInstance('Horde_Alarm');
if ($hordeAlarm->exists($this->uid, $GLOBALS['registry']->getAuth()) &&
$hordeAlarm->isSnoozed($this->uid, $GLOBALS['registry']->getAuth())) {
$vTodo->setAttribute('X-MOZ-LASTACK', new Horde_Date($_SERVER['REQUEST_TIME']));
$alarm = $hordeAlarm->get($this->uid, $GLOBALS['registry']->getAuth());
if (!empty($alarm['snooze'])) {
$alarm['snooze']->setTimezone(date_default_timezone_get());
$vTodo->setAttribute('X-MOZ-SNOOZE-TIME', $alarm['snooze']);
}
}
}
}

Expand Down

0 comments on commit 95cb1c5

Please sign in to comment.