Marks the given notification as read.

@param  int $notification_id

@return void
973991
public function markNotificationAsRead($notification_id)
    {
        $notification = $this->notifications()
            ->where('id', $notification_id)
            ->whereNull('read_at');

        if ($notification->exists()) {
            $notification->first()->markAsRead();
        }
    }
525275
public function read(User $user, Notification $notification)
    {
        $notification->markAsRead();

        return $this->index($user, 'unread');
    }
27318
public function mark_pm_read($messageId)
    {
        try {
            $manager = $this->container->get('symbb.extension.tapatalk.manager.user');
            return $manager->markPmRead($messageId);
        } catch (\Exception $exc) {
            return $this->errorResponse($exc);
        }
    }
471259
public function send(Notification $notification)
    {
        $original = clone $notification;

        foreach ($notification->via() as $channel => $notifiables) {
            $notifiables = $this->formatNotifiables($notifiables);

            foreach ($notifiables as $notifiable) {
                $notificationId = Uuid::uuid4()->toString();
                $notification = clone $original;

                if (! $notification->id) {
                    $notification->id = $notificationId;
                }

                if (! $this->shouldSendNotification($notifiable, $notification, $channel)) {
                    continue;
                }

                $response = $this->channel($channel)->send($notifiable, $notification);

                $event = new SendEvent([
                    'notification' => $notification,
                    'notifiable' => $notifiable,
                    'channel' => $channel,
                    'response' => $response,
                ]);

                $this->trigger(self::EVENT_AFTER_SEND, $event);
            }
        }
    }
655725
protected function setReview($review_id)
    {
        $this->data_review = array();

        if (is_numeric($review_id)) {

            $this->data_review = $this->review->get($review_id);

            if (empty($this->data_review)) {
                $this->outputHttpStatus(404);
            }
        }
    }
926322
protected function pushNotification($notification, $notifiable)
    {
        if ($notifiable instanceof NotifiableGroup) {
            foreach ($notifiable->getGroup() as $toBeNotified) {
                $this->push($notification, $toBeNotified);
            }
        } else {
            // @todo Change this fucking shite
            $notification = $notifiable->notifications()->create($notification);

            event(new NotificationAdded($notification, $notifiable));
        }
    }
101194
public function markAsUnread($notifications)
    {
        if ( ! is_array($notifications)) {
            $notifications = func_get_args();
        }

        $notifications = $this->store->markAsUnread($notifications);

        foreach ($notifications as $notification) {
            event(new NotificationUnread($notification));
        }

        return count($notifications) == 1 ? $notifications[0] : $notifications;
    }
937720
public function markEmailRead( $email_id = null ) {
		if ( ! $email_id ) {
			$this->assertNotEmpty( $this->_current_email, 'The current email is not selected' );
			$email_id = $this->_current_email['id'];
		}

		$this->_send_patch_request( '/messages/' . $email_id, array(
			'message' => array( 'is_read' => true )
		) );
	}
1250392
def mark_notifications_as_read(self, last_read_at=datetime.datetime.utcnow()):
        
        assert isinstance(last_read_at, datetime.datetime)
        put_parameters = {
            "last_read_at": last_read_at.strftime('%Y-%m-%dT%H:%M:%SZ')
        }

        headers, data = self._requester.requestJsonAndCheck(
            "PUT",
            "/notifications",
            input=put_parameters
        )
1177553
public function markRead()
    {
        if ($this->sender_status == self::STATUS_NEW) {
            $this->sender_status = self::STATUS_READ;
            if ($this->save()) {
                Podium::getInstance()->podiumCache->deleteElement('user.newmessages', $this->sender_id);
            }
        }
    }
1367995
public function markReadThread($id, $unread = true, $read = true)
	{
		// Build the request path.
		$path = '/notifications/threads/' . $id;

		$data = array(
			'unread' => $unread,
			'read'   => $read,
		);

		return $this->processResponse(
			$this->client->patch($this->fetchUrl($path), json_encode($data)),
			205
		);
	}
828736
public function unread($id, ReadNotificationRequest $request)
    {
        $user = $request->user();
        $item = $user->notifications()->find($id);
        if (empty($item)) {
            return $this->sendError('Notification not found');
        }
        $item->markAsUnread();

        return $this->sendResponse($item, '');
    }
617410
public function send(string $recipientID, Notification $notification): void
    {
        $app = App::get();

        if ($notification->id === null) {
            $notification->id = 'n' . uniqid() . 'x' . base_convert(rand(0, 999999999), 10, 16);
        }
        if ($notification->dateCreated === null) {
            $notification->dateCreated = time();
        }

        if ($this->hasEventListeners('beforeSendNotification')) {
            $eventDetails = new \IvoPetkov\BearFrameworkAddons\Notifications\BeforeSendNotificationEventDetails($recipientID, $notification);
            $this->dispatchEvent('beforeSendNotification', $eventDetails);
            if ($eventDetails->preventDefault) {
                return;
            }
        }

        if (strlen($notification->type) > 0) {
            $otherNotifications = $this->getList($recipientID);
            foreach ($otherNotifications as $otherNotification) {
                if ((string) $notification->type === (string) $otherNotification->type) {
                    $this->delete($recipientID, $otherNotification->id);
                }
            }
        }

        $this->set($recipientID, $notification);

        if ($this->hasEventListeners('sendNotification')) {
            $eventDetails = new \IvoPetkov\BearFrameworkAddons\Notifications\SendNotificationEventDetails($recipientID, $notification);
            $this->dispatchEvent('sendNotification', $eventDetails);
        }
    }
428882
public void incrementUnreadNotification(final AbstractNotificationView view,
            final EventContainer<?> newEventContainer) {
        if (!view.equals(currentView) || newEventContainer.getUnreadNotificationMessageKey() == null) {
            return;
        }
        NotificationUnreadValue notificationUnreadValue = unreadNotifications.get(newEventContainer.getClass());
        if (notificationUnreadValue == null) {
            notificationUnreadValue = new NotificationUnreadValue(0,
                    newEventContainer.getUnreadNotificationMessageKey());
            unreadNotifications.put(newEventContainer.getClass(), notificationUnreadValue);
        }

        notificationUnreadValue.incrementUnreadNotifications();
        unreadNotificationCounter++;
        refreshCaption();
    }
752063
public function findAllByNotification($id, $seen = null)
    {
        $qb = $this
            ->createQueryBuilder('notifiable')
            ->join('notifiable.notifiableNotifications', 'nn')
            ->join('nn.notification', 'notification')
            ->where('notification.id = :notification_id')
            ->setParameter('notification_id', $id)
        ;

        if ($seen !== null) {
            $whereSeen = $seen ? 1 : 0;
            $qb
                ->andWhere('nn.seen = :seen')
                ->setParameter('seen', $whereSeen)
            ;
        }

        return $qb->getQuery()->getResult();
    }
374580
public function send($notifiable, Notification $notification)
    {
        $message = $notification->toMessagebird($notifiable);

        if (is_string($message)) {
            $message = MessagebirdMessage::create($message);
        }

        if ($to = $notifiable->routeNotificationFor('messagebird')) {
            $message->setRecipients($to);
        }

        $this->client->send($message);
    }
124719
public void markAsViewed(int notificationId) {
		getResourceFactory()
				.getApiResource("/notification/" + notificationId + "/viewed")
				.entity(new Empty(), MediaType.APPLICATION_JSON_TYPE).post();
	}