Improve quote share ("message_id" added)
This commit is contained in:
parent
fe442683ef
commit
48182a95fb
8 changed files with 27 additions and 27 deletions
|
@ -621,6 +621,7 @@ function item_post(App $a) {
|
|||
$datarray["author-uri-id"] = ItemURI::getIdByURI($datarray["author-link"]);
|
||||
$datarray["owner-updated"] = '';
|
||||
$datarray["has-media"] = false;
|
||||
$datarray['body'] = Item::improveSharedDataInBody($datarray);
|
||||
|
||||
$o = DI::conversation()->create([array_merge($contact_record, $datarray)], 'search', false, true);
|
||||
|
||||
|
@ -661,6 +662,7 @@ function item_post(App $a) {
|
|||
}
|
||||
|
||||
$datarray['uri-id'] = ItemURI::getIdByURI($datarray['uri']);
|
||||
$datarray['body'] = Item::improveSharedDataInBody($datarray);
|
||||
|
||||
if ($orig_post) {
|
||||
$fields = [
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
|
@ -34,8 +33,7 @@ function share_init(App $a) {
|
|||
System::exit();
|
||||
}
|
||||
|
||||
$fields = ['private', 'body', 'author-name', 'author-link', 'author-avatar',
|
||||
'guid', 'created', 'plink', 'title'];
|
||||
$fields = ['private', 'body', 'uri'];
|
||||
$item = Post::selectFirst($fields, ['id' => $post_id]);
|
||||
|
||||
if (!DBA::isResult($item) || $item['private'] == Item::PRIVATE) {
|
||||
|
@ -46,14 +44,7 @@ function share_init(App $a) {
|
|||
$pos = strpos($item['body'], "[share");
|
||||
$o = substr($item['body'], $pos);
|
||||
} else {
|
||||
$o = BBCode::getShareOpeningTag($item['author-name'], $item['author-link'], $item['author-avatar'], $item['plink'], $item['created'], $item['guid']);
|
||||
|
||||
if ($item['title']) {
|
||||
$o .= '[h3]'.$item['title'].'[/h3]'."\n";
|
||||
}
|
||||
|
||||
$o .= $item['body'];
|
||||
$o .= "[/share]";
|
||||
$o = "[share message_id='" . $item['uri'] . "'][/share]";
|
||||
}
|
||||
|
||||
echo $o;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue