diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2019-05-18 00:07:09 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2019-05-18 00:07:09 -0100 |
commit | ae4ba193b86e4316cbedc3c562af2f78c5d4089c (patch) | |
tree | dc0c4100c76c5ddeed4c77c268e1970e82155aeb | |
parent | a9e46125cca4dd57c43cbeaf0d68493d0f950a8c (diff) |
add creation time on SocialAppNotification
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r-- | lib/Interfaces/Internal/SocialAppNotificationInterface.php | 3 | ||||
-rw-r--r-- | lib/Interfaces/Object/FollowInterface.php | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/Interfaces/Internal/SocialAppNotificationInterface.php b/lib/Interfaces/Internal/SocialAppNotificationInterface.php index 0d7ef9c4..0c05eb4c 100644 --- a/lib/Interfaces/Internal/SocialAppNotificationInterface.php +++ b/lib/Interfaces/Internal/SocialAppNotificationInterface.php @@ -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); } diff --git a/lib/Interfaces/Object/FollowInterface.php b/lib/Interfaces/Object/FollowInterface.php index af43f3b8..6f45cf82 100644 --- a/lib/Interfaces/Object/FollowInterface.php +++ b/lib/Interfaces/Object/FollowInterface.php @@ -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') |