summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-06-27 14:28:57 -0100
committerMaxence Lange <maxence@artificial-owl.com>2019-06-27 14:28:57 -0100
commit250c7392a02760231d98c037ec5fef6f3279018a (patch)
treeac6fe1eeecec8935f3f34e16d2e72590c0e4c988 /lib
parent419d2a3cd2fe1245ca6562f567c78efdc19a5a1f (diff)
account instead of actor
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Db/StreamRequestBuilder.php2
-rw-r--r--lib/Interfaces/Object/FollowInterface.php12
2 files changed, 9 insertions, 5 deletions
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);