diff --git a/lib/Db/StreamRequestBuilder.php b/lib/Db/StreamRequestBuilder.php index f0f5fe51..4f496f26 100644 --- a/lib/Db/StreamRequestBuilder.php +++ b/lib/Db/StreamRequestBuilder.php @@ -97,7 +97,7 @@ class StreamRequestBuilder extends CoreRequestBuilder { 's.type', 's.to', 's.to_array', 's.cc', 's.bcc', 's.content', 's.summary', 's.attachments', 's.published', 's.published_time', 's.cache', 's.object_id', 's.attributed_to', 's.in_reply_to', 's.source', 's.local', - 's.instances', 's.creation', 's.hidden_on_timeline' + 's.instances', 's.creation', 's.hidden_on_timeline', 's.details' ) ->from(self::TABLE_STREAMS, 's'); diff --git a/lib/Interfaces/Object/FollowInterface.php b/lib/Interfaces/Object/FollowInterface.php index 224386d0..1123e2e8 100644 --- a/lib/Interfaces/Object/FollowInterface.php +++ b/lib/Interfaces/Object/FollowInterface.php @@ -53,6 +53,7 @@ use OCA\Social\Model\ActivityPub\ACore; use OCA\Social\Model\ActivityPub\Activity\Accept; use OCA\Social\Model\ActivityPub\Activity\Reject; use OCA\Social\Model\ActivityPub\Activity\Undo; +use OCA\Social\Model\ActivityPub\Actor\Person; use OCA\Social\Model\ActivityPub\Internal\SocialAppNotification; use OCA\Social\Model\ActivityPub\Object\Follow; use OCA\Social\Model\InstancePath; @@ -146,7 +147,7 @@ class FollowInterface implements IActivityPubInterface { $actor = $this->cacheActorService->getFromId($follow->getObjectId()); $this->accountService->cacheLocalActorDetailCount($actor); - $this->generateNotification($follow); + $this->generateNotification($actor, $follow); } catch (Exception $e) { $this->miscService->log( 'exception while confirmFollowRequest: ' . get_class($e) . ' - ' . $e->getMessage(), @@ -266,22 +267,25 @@ class FollowInterface implements IActivityPubInterface { /** + * @param Person $actor * @param Follow $follow * * @throws ItemUnknownException * @throws SocialAppConfigException */ - private function generateNotification(Follow $follow) { + private function generateNotification(Person $actor, Follow $follow) { /** @var SocialAppNotificationInterface $notificationInterface */ $notificationInterface = AP::$activityPub->getInterfaceFromType(SocialAppNotification::TYPE); /** @var SocialAppNotification $notification */ $notification = AP::$activityPub->getItemFromType(SocialAppNotification::TYPE); - $notification->addDetail('actor', $follow->getActorId()); + $notification->setDetail('account', $actor->getAccount()); + $notification->setDetail('url', $actor->getId()); $notification->setAttributedTo($follow->getActorId()) ->setId($follow->getId() . '/notification') - ->setSummary('{actor} is following you') + ->setActorId($actor->getId()) + ->setSummary('{account} is following you') ->setTo($follow->getObjectId()) ->setLocal(true);