add creation time on SocialAppNotification

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
feature/573/request-on-host-meta
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;
}
$notification->setPublished(date("c"));
$notification->convertPublished();
$this->miscService->log('Generating notification: ' . json_encode($notification, JSON_UNESCAPED_SLASHES), 1);
$this->streamRequest->save($notification);
}

Wyświetl plik

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