Fix #2558: No notification for user profile posts send

This commit is contained in:
buddh4 2017-06-07 19:21:52 +02:00
parent b7d2b0a0cf
commit 0fd985e6fe
3 changed files with 15 additions and 4 deletions

View File

@ -23,6 +23,8 @@ HumHub Change Log
- Fix: Send button text on request space membership dialog - Fix: Send button text on request space membership dialog
- Fix #2555: Friendship notification category visible even if friendship system deactivated - Fix #2555: Friendship notification category visible even if friendship system deactivated
- Enh: Don't auto focus space chooser search on small devices - Enh: Don't auto focus space chooser search on small devices
- Fix #2612: Single list item hides markers
- Fix #2558: No notification for user profile posts send
1.2.0 (April 16, 2017) 1.2.0 (April 16, 2017)
-------------------------------- --------------------------------

View File

@ -43,10 +43,18 @@ class ContentCreated extends \humhub\modules\notification\components\BaseNotific
*/ */
public function html() public function html()
{ {
return Yii::t('ContentModule.notifications_views_ContentCreated', '{displayName} created {contentTitle}.', [ if($this->source->content->container instanceof User && $this->record->user->is($this->source->content->container)) {
'displayName' => Html::tag('strong', Html::encode($this->originator->displayName)), return Yii::t('ContentModule.notifications_views_ContentCreated', '{displayName} posted on your profile {contentTitle}.', [
'contentTitle' => $this->getContentInfo($this->source) 'displayName' => Html::tag('strong', Html::encode($this->originator->displayName)),
]); 'contentTitle' => $this->getContentInfo($this->source, false)
]);
} else {
return Yii::t('ContentModule.notifications_views_ContentCreated', '{displayName} created {contentTitle}.', [
'displayName' => Html::tag('strong', Html::encode($this->originator->displayName)),
'contentTitle' => $this->getContentInfo($this->source)
]);
}
} }
/** /**

View File

@ -206,6 +206,7 @@ class NotificationManager
// Note the notification follow logic for users is currently not implemented. // Note the notification follow logic for users is currently not implemented.
// TODO: perhaps return only friends if public is false? // TODO: perhaps return only friends if public is false?
$result = (!$public) ? [] : Follow::getFollowersQuery($container, true)->all(); $result = (!$public) ? [] : Follow::getFollowersQuery($container, true)->all();
$result[] = $container;
} }
return $result; return $result;
} }