add creation time on SocialAppNotification

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/530/head
Maxence Lange 2019-05-18 00:07:09 -01:00
rodzic a9e46125cc
commit ae4ba193b8
2 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -110,6 +110,9 @@ class SocialAppNotificationInterface implements IActivityPubInterface {
return; return;
} }
$notification->setPublished(date("c"));
$notification->convertPublished();
$this->miscService->log('Generating notification: ' . json_encode($notification, JSON_UNESCAPED_SLASHES), 1); $this->miscService->log('Generating notification: ' . json_encode($notification, JSON_UNESCAPED_SLASHES), 1);
$this->streamRequest->save($notification); $this->streamRequest->save($notification);
} }

Wyświetl plik

@ -254,13 +254,15 @@ class FollowInterface implements IActivityPubInterface {
* @param Follow $follow * @param Follow $follow
* *
* @throws ItemUnknownException * @throws ItemUnknownException
* @throws SocialAppConfigException
*/ */
private function generateNotification(Follow $follow) { private function generateNotification(Follow $follow) {
/** @var SocialAppNotificationInterface $notificationInterface */ /** @var SocialAppNotificationInterface $notificationInterface */
$notificationInterface = $notificationInterface =
AP::$activityPub->getInterfaceFromType(SocialAppNotification::TYPE); AP::$activityPub->getInterfaceFromType(SocialAppNotification::TYPE);
$notification = new SocialAppNotification(); /** @var SocialAppNotification $notification */
$notification = AP::$activityPub->getItemFromType(SocialAppNotification::TYPE);
$notification->setAttributedTo($follow->getActorId()) $notification->setAttributedTo($follow->getActorId())
->setId($follow->getId() . '/notification') ->setId($follow->getId() . '/notification')
->setSummary('{actor} is following you') ->setSummary('{actor} is following you')