mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-08 08:14:25 +02:00
API: added positiv list for quote support
This commit is contained in:
parent
a86fbe37c9
commit
49d513f8d2
23 changed files with 114 additions and 55 deletions
|
@ -198,33 +198,6 @@ class Status extends BaseFactory
|
|||
$poll = null;
|
||||
}
|
||||
|
||||
$shared = $this->contentItem->getSharedPost($item, ['uri-id']);
|
||||
if (!empty($shared)) {
|
||||
$shared_uri_id = $shared['post']['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);
|
||||
}
|
||||
}
|
||||
|
||||
if ($display_quote) {
|
||||
$quote = self::createQuote($item, $uid);
|
||||
|
||||
|
@ -239,6 +212,33 @@ class Status extends BaseFactory
|
|||
$quote = self::createQuote($item, $uid);
|
||||
}
|
||||
|
||||
$shared = $this->contentItem->getSharedPost($item, ['uri-id']);
|
||||
if (!empty($shared)) {
|
||||
$shared_uri_id = $shared['post']['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);
|
||||
}
|
||||
}
|
||||
|
||||
$item['body'] = $this->contentItem->addSharedPost($item);
|
||||
|
||||
if (!is_null($item['raw-body'])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue