mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 14:18:27 +01:00
Fix #3806: Using Receive notifications for new content
will not include the space to the notification setting view until settings are saved
This commit is contained in:
parent
645ee4d894
commit
e104334c29
@ -38,7 +38,7 @@ HumHub Change Log (DEVELOP)
|
||||
- Enh: Update Yii version to 2.0.32
|
||||
- Enh #3822 Added content id to notification urls as fallback in case notification was deleted
|
||||
- Fix: Settings cli rewrite dynamic config when required
|
||||
|
||||
- Fix #3806: Using `Receive notifications for new content` will not include the space to the notification setting view until settings are saved
|
||||
|
||||
1.4.0-beta.2
|
||||
------------
|
||||
|
@ -260,15 +260,21 @@ class NotificationManager
|
||||
*/
|
||||
public function getSpaces(User $user)
|
||||
{
|
||||
$isLoaded = (Yii::$app->getModule('notification')->settings->user($user)->get('notification.like_email') !== null);
|
||||
if ($isLoaded) {
|
||||
$memberSpaces = Membership::getUserSpaceQuery($user, true, true)->all();
|
||||
$followSpaces = Follow::getFollowedSpacesQuery($user, true)->all();
|
||||
$memberSpaces = Membership::getUserSpaceQuery($user, true, true)->all();
|
||||
$followSpaces = Follow::getFollowedSpacesQuery($user, true)->all();
|
||||
|
||||
return array_merge($memberSpaces, $followSpaces);
|
||||
} else {
|
||||
return Space::findAll(['guid' => Yii::$app->getModule('notification')->settings->getSerialized('sendNotificationSpaces')]);
|
||||
$result = array_merge($memberSpaces, $followSpaces);
|
||||
|
||||
if($this->isUntouchedSettings($user)) {
|
||||
$result = array_merge($result, Space::findAll(['guid' => Yii::$app->getModule('notification')->settings->getSerialized('sendNotificationSpaces')]));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function isUntouchedSettings(User $user)
|
||||
{
|
||||
return Yii::$app->getModule('notification')->settings->user($user)->get('notification.like_email') === null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user