Fix #2555: Friendship notification category visible even if friendship system deactivated

This commit is contained in:
buddh4 2017-06-07 15:38:09 +02:00
parent 7d1a321767
commit a928988195
2 changed files with 10 additions and 0 deletions

View File

@ -21,6 +21,7 @@ HumHub Change Log
- Fix: Invite Users does not respect ManageUsers/ManageGroups permission
- Fix: Mail summaries sent in incorrect language
- Fix: Send button text on request space membership dialog
- Fix #2555: Friendship notification category visible even if friendship system deactivated
1.2.0 (April 16, 2017)
--------------------------------

View File

@ -8,6 +8,7 @@
namespace humhub\modules\friendship\notifications;
use humhub\modules\user\models\User;
use Yii;
use humhub\modules\notification\components\NotificationCategory;
use humhub\modules\notification\targets\BaseTarget;
@ -61,4 +62,12 @@ class FriendshipNotificationCategory extends NotificationCategory
return $target->defaultSetting;
}
/**
* @inheritdoc
*/
public function isVisible(User $user = null)
{
return Yii::$app->getModule('friendship')->getIsEnabled();
}
}