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