Some more improvements for posts with shares
This commit is contained in:
parent
db82bdfc44
commit
c65fff6f93
10 changed files with 100 additions and 99 deletions
|
@ -122,9 +122,9 @@ function display_init(App $a)
|
|||
|
||||
function display_fetchauthor($item)
|
||||
{
|
||||
$shared = Item::getShareArray($item);
|
||||
if (empty($shared['comment']) && !empty($shared['guid']) && !empty($shared['profile'])) {
|
||||
$contact = Contact::getByURLForUser($shared['profile'], DI::userSession()->getLocalUserId());
|
||||
$shared = DI::contentItem()->getSharedPost($item, ['author-link']);
|
||||
if (!empty($shared) && empty($shared['comment'])) {
|
||||
$contact = Contact::getByURLForUser($shared['post']['author-link'], DI::userSession()->getLocalUserId());
|
||||
}
|
||||
|
||||
if (empty($contact)) {
|
||||
|
|
|
@ -41,9 +41,9 @@ function share_init(App $a) {
|
|||
System::exit();
|
||||
}
|
||||
|
||||
$shared = Item::getShareArray($item);
|
||||
if (empty($shared['comment']) && (!empty($shared['message_id']) || !empty($shared['link']))) {
|
||||
$content = '[share]' . ($shared['message_id'] ?: $shared['link']) . '[/share]';
|
||||
$shared = DI::contentItem()->getSharedPost($item, ['uri']);
|
||||
if (!empty($shared) && empty($shared['comment'])) {
|
||||
$content = '[share]' . $shared['post']['uri'] . '[/share]';
|
||||
} else {
|
||||
$content = '[share]' . $item['uri'] . '[/share]';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue