kopia lustrzana https://github.com/nextcloud/social
rodzic
abb9402b57
commit
96f4b87558
|
@ -319,7 +319,9 @@ class AnnounceInterface extends AbstractActivityPubInterface implements IActivit
|
||||||
/** @var SocialAppNotification $notification */
|
/** @var SocialAppNotification $notification */
|
||||||
$notification = AP::$activityPub->getItemFromType(SocialAppNotification::TYPE);
|
$notification = AP::$activityPub->getItemFromType(SocialAppNotification::TYPE);
|
||||||
// $notification->setDetail('url', '');
|
// $notification->setDetail('url', '');
|
||||||
|
|
||||||
$notification->setDetailItem('post', $post);
|
$notification->setDetailItem('post', $post);
|
||||||
|
$notification->setDetailInt('nid', $post->getNid());
|
||||||
$notification->addDetail('accounts', $author->getAccount());
|
$notification->addDetail('accounts', $author->getAccount());
|
||||||
$notification->setAttributedTo($author->getId())
|
$notification->setAttributedTo($author->getId())
|
||||||
->setSubType(Announce::TYPE)
|
->setSubType(Announce::TYPE)
|
||||||
|
|
|
@ -204,6 +204,7 @@ class LikeInterface extends AbstractActivityPubInterface implements IActivityPub
|
||||||
$notification = AP::$activityPub->getItemFromType(SocialAppNotification::TYPE);
|
$notification = AP::$activityPub->getItemFromType(SocialAppNotification::TYPE);
|
||||||
// $notification->setDetail('url', '');
|
// $notification->setDetail('url', '');
|
||||||
$notification->setDetailItem('post', $post);
|
$notification->setDetailItem('post', $post);
|
||||||
|
$notification->setDetailInt('nid', $post->getNid());
|
||||||
$notification->addDetail('accounts', $author->getAccount());
|
$notification->addDetail('accounts', $author->getAccount());
|
||||||
$notification->setAttributedTo($author->getId())
|
$notification->setAttributedTo($author->getId())
|
||||||
->setSubType(Like::TYPE)
|
->setSubType(Like::TYPE)
|
||||||
|
|
|
@ -495,7 +495,7 @@ class Stream extends ACore implements IQueryRow, JsonSerializable {
|
||||||
parent::importFromCache($data);
|
parent::importFromCache($data);
|
||||||
|
|
||||||
$actor = new Person();
|
$actor = new Person();
|
||||||
$actor->importFromCache($data['actor_info']);
|
$actor->importFromCache($data['actor_info'] ?? []);
|
||||||
$this->setActor($actor);
|
$this->setActor($actor);
|
||||||
$this->setCompleteDetails(true);
|
$this->setCompleteDetails(true);
|
||||||
}
|
}
|
||||||
|
@ -605,16 +605,16 @@ class Stream extends ACore implements IQueryRow, JsonSerializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
$status = null;
|
$status = null;
|
||||||
if ($statusPost = $this->getDetails('post')) {
|
$statusPost = $this->getDetails('post');
|
||||||
if (sizeof($statusPost) > 0) {
|
if (sizeof($statusPost) > 0) {
|
||||||
$status = new Stream();
|
$status = new Stream();
|
||||||
$status->importFromCache($statusPost);
|
$status->importFromCache($statusPost);
|
||||||
$status->setExportFormat(self::FORMAT_LOCAL);
|
$status->setNid($this->getDetailInt('nid'));
|
||||||
}
|
$status->setExportFormat(self::FORMAT_LOCAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = [
|
$result = [
|
||||||
'id' => $this->getId(),
|
'id' => (string)$this->getNid(),
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'created_at' => $this->getOriginCreationTime(),
|
'created_at' => $this->getOriginCreationTime(),
|
||||||
'status' => $status,
|
'status' => $status,
|
||||||
|
|
|
@ -113,6 +113,10 @@ trait TDetails {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getDetailInt(string $detail, int $default = 0): int {
|
||||||
|
return $this->details[$detail] ?? $default;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $detail
|
* @param string $detail
|
||||||
* @param string $value
|
* @param string $value
|
||||||
|
|
Ładowanie…
Reference in New Issue