1
0
Fork 0

The quote functionality is simplified

This commit is contained in:
Michael 2022-10-09 21:16:36 +00:00
commit 0d3aa681b4
10 changed files with 170 additions and 257 deletions

View file

@ -595,14 +595,7 @@ function item_post(App $a) {
$datarray['protocol'] = Conversation::PARCEL_DIRECT;
$datarray['direction'] = Conversation::PUSH;
if ($orig_post) {
$datarray['edit'] = true;
} else {
// If this was a share, add missing data here
$datarray = Item::addShareDataFromOriginal($datarray);
$datarray['edit'] = false;
}
$datarray['edit'] = $orig_post;
// Check for hashtags in the body and repair or add hashtag links
if ($preview || $orig_post) {

View file

@ -42,11 +42,8 @@ function share_init(App $a) {
}
$shared = BBCode::fetchShareAttributes($item['body']);
if (!empty($shared['message_id']) || !empty($shared['link'])) {
if (empty($shared['comment']) && (!empty($shared['message_id']) || !empty($shared['link']))) {
$content = '[share]' . ($shared['message_id'] ?: $shared['link']) . '[/share]';
} elseif (strpos($item['body'], '[/share]') !== false) {
$pos = strpos($item['body'], '[share');
$content = substr($item['body'], $pos);
} else {
$content = '[share]' . $item['uri'] . '[/share]';
}