Mark notification as read if a card with duedate gets archived

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-12-20 10:45:56 +01:00
parent cf41665c0a
commit 8b750b7c7c
2 changed files with 10 additions and 0 deletions

View File

@@ -95,6 +95,15 @@ class NotificationHelper {
$this->cardMapper->markNotified($card);
}
public function markDuedateAsRead($card) {
$notification = $this->notificationManager->createNotification();
$notification
->setApp('deck')
->setObject('card', $card->getId())
->setSubject('card-overdue', []);
$this->notificationManager->markProcessed($notification);
}
public function sendCardAssigned($card, $userId) {
$boardId = $this->cardMapper->findBoardId($card->getId());
$board = $this->getBoard($boardId);

View File

@@ -407,6 +407,7 @@ class CardService {
$card = $this->cardMapper->find($id);
$card->setArchived(true);
$newCard = $this->cardMapper->update($card);
$this->notificationHelper->markDuedateAsRead($card);
$this->activityManager->triggerEvent(ActivityManager::DECK_OBJECT_CARD, $newCard, ActivityManager::SUBJECT_CARD_UPDATE_ARCHIVE);
$this->changeHelper->cardChanged($id, false);
return $newCard;