Skip to content

Commit

Permalink
Enh #221: By default, enabled Mobile notification types for those ena…
Browse files Browse the repository at this point in the history
…bled for Web
  • Loading branch information
marc-farre committed Sep 9, 2024
1 parent fb433a2 commit ec37e3a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 43 deletions.
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

1.8.6 (Unreleased)
----------------------
- Enh #221: By default, enabled "Mobile" notification types for those enabled for "Web"

1.8.5 (March 14, 2024)
----------------------
- Fix #249: Fix replaced method `friendship\Module::isEnabled()`
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Tasks",
"description": "Intuitive task management tool with many basic and advanced features.",
"keywords": ["task", "todo"],
"version": "1.8.5",
"version": "1.8.6",
"homepage": "https://github.com/humhub/tasks",
"humhub": {
"minVersion": "1.14"
Expand Down
21 changes: 1 addition & 20 deletions notifications/TaskNotificationCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@

namespace humhub\modules\tasks\notifications;

use Yii;
use humhub\modules\notification\components\NotificationCategory;
use humhub\modules\notification\targets\BaseTarget;
use humhub\modules\notification\targets\MailTarget;
use humhub\modules\notification\targets\WebTarget;
use humhub\modules\notification\targets\MobileTarget;
use Yii;

/**
* SpaceMemberNotificationCategory
Expand Down Expand Up @@ -44,19 +40,4 @@ public function getDescription()
{
return Yii::t('TasksModule.base', 'Receive Notifications for Tasks (Deadline Updates, Status changes ...).');
}

/**
* @inheritdoc
*/
public function getDefaultSetting(BaseTarget $target)
{
if($target instanceof WebTarget || $target instanceof MailTarget) {
return true;
} else if ($target instanceof MobileTarget) {
return false;
}

return $target->defaultSetting;
}

}
23 changes: 1 addition & 22 deletions notifications/TaskReminderCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@

namespace humhub\modules\tasks\notifications;

use Yii;
use humhub\modules\notification\components\NotificationCategory;
use humhub\modules\notification\targets\BaseTarget;
use humhub\modules\notification\targets\MailTarget;
use humhub\modules\notification\targets\WebTarget;
use humhub\modules\notification\targets\MobileTarget;
use Yii;

/**
* SpaceMemberNotificationCategory
Expand Down Expand Up @@ -44,21 +40,4 @@ public function getDescription()
{
return Yii::t('TasksModule.base', 'Receive Notifications for Task Reminder.');
}

/**
* @inheritdoc
*/
public function getDefaultSetting(BaseTarget $target)
{
if ($target->id === MailTarget::getId()) {
return true;
} else if ($target->id === WebTarget::getId()) {
return true;
} else if ($target->id === MobileTarget::getId()) {
return true;
}

return $target->defaultSetting;
}

}

0 comments on commit ec37e3a

Please sign in to comment.