Пример #1
0
 /**
  * @inheritdoc
  */
 public function send(User $user)
 {
     // Check if there is also a mention notification, so skip this notification
     if (\humhub\modules\notification\models\Notification::find()->where(['class' => \humhub\modules\user\notifications\Mentioned::className(), 'user_id' => $user->id, 'source_class' => $this->source->className(), 'source_pk' => $this->source->getPrimaryKey()])->count() > 0) {
         return;
     }
     return parent::send($user);
 }
Пример #2
0
 /**
  * inheritdoc
  */
 public function send(\humhub\modules\user\models\User $user)
 {
     // Do additional access check here, because the mentioned user may have
     // no access to the content
     if (!$this->source->content->canRead($user->id)) {
         return;
     }
     return parent::send($user);
 }
Пример #3
0
 /**
  * @inheritdoc
  */
 public function send(User $user)
 {
     // Check there is also an mentioned notifications, so ignore this notification
     /*
      if (Notification::model()->findByAttributes(array('class' => 'MentionedNotification', 'source_object_model' => 'Comment', 'source_object_id' => $comment->id)) !== null) {
      continue;
      }
     */
     return parent::send($user);
 }