kopia lustrzana https://github.com/nextcloud/social
account instead of actor
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>pull/531/head
rodzic
419d2a3cd2
commit
250c7392a0
|
@ -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');
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue