mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-11 17:44:27 +02:00
Contact suggestions are now cached
This commit is contained in:
parent
8eda9dfe7c
commit
f31e617f5d
13 changed files with 218 additions and 17 deletions
|
@ -167,9 +167,23 @@ class Status extends BaseFactory
|
|||
if (!empty($shared)) {
|
||||
$shared_uri_id = $shared['post']['uri-id'];
|
||||
|
||||
$mentions = array_merge($mentions, $this->mstdnMentionFactory->createFromUriId($shared_uri_id)->getArrayCopy());
|
||||
$tags = array_merge($tags, $this->mstdnTagFactory->createFromUriId($shared_uri_id));
|
||||
$attachments = array_merge($attachments, $this->mstdnAttachementFactory->createFromUriId($shared_uri_id));
|
||||
foreach ($this->mstdnMentionFactory->createFromUriId($shared_uri_id)->getArrayCopy() as $mention) {
|
||||
if (!in_array($mention, $mentions)) {
|
||||
$mentions[] = $mention;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->mstdnTagFactory->createFromUriId($shared_uri_id) as $tag) {
|
||||
if (!in_array($tag, $tags)) {
|
||||
$tags[] = $tag;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->mstdnAttachementFactory->createFromUriId($shared_uri_id) as $attachment) {
|
||||
if (!in_array($attachment, $attachments)) {
|
||||
$attachments[] = $attachment;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($card->toArray())) {
|
||||
$card = $this->mstdnCardFactory->createFromUriId($shared_uri_id);
|
||||
|
@ -190,7 +204,7 @@ class Status extends BaseFactory
|
|||
if ($is_reshare) {
|
||||
$reshare = $this->createFromUriId($uriId, $uid, false)->toArray();
|
||||
}
|
||||
|
||||
// $mentions = array_unique($mentions);
|
||||
return new \Friendica\Object\Api\Mastodon\Status($item, $account, $counts, $userAttributes, $sensitive, $application, $mentions, $tags, $card, $attachments, $reshare, $poll);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue