Merge pull request #530 from nextcloud/bugfix/noid/creation-time

add creation time on SocialAppNotification
pull/532/head
Maxence Lange 2019-05-18 00:08:03 -01:00 zatwierdzone przez GitHub
commit 6291507b66
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
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')