Merge branch 'dev'

This commit is contained in:
zotlabs 2020-05-13 18:53:38 -07:00
commit a2fd6320d1
4 changed files with 63 additions and 48 deletions

View file

@ -317,6 +317,7 @@ class Item extends Controller {
$parent = ((x($_REQUEST,'parent')) ? intval($_REQUEST['parent']) : 0);
$parent_mid = ((x($_REQUEST,'parent_mid')) ? trim($_REQUEST['parent_mid']) : '');
$hidden_mentions = ((x($_REQUEST,'hidden_mentions')) ? trim($_REQUEST['hidden_mentions']) : '');
/**
* Who is viewing this page and posting this thing
@ -393,7 +394,7 @@ class Item extends Controller {
$plink = ((x($_REQUEST,'permalink')) ? escape_tags($_REQUEST['permalink']) : '');
$obj_type = ((x($_REQUEST,'obj_type')) ? escape_tags($_REQUEST['obj_type']) : ACTIVITY_OBJ_NOTE);
// allow API to bulk load a bunch of imported items with sending out a bunch of posts.
// allow API to bulk load a bunch of imported items without sending out a bunch of posts.
$nopush = ((x($_REQUEST,'nopush')) ? intval($_REQUEST['nopush']) : 0);
/*
@ -843,9 +844,6 @@ class Item extends Controller {
if($mimetype === 'text/bbcode') {
require_once('include/text.php');
// BBCODE alert: the following functions assume bbcode input
// and will require alternatives for alternative content-types (text/html, text/markdown, text/plain, etc.)
// we may need virtual or template classes to implement the possible alternatives
@ -864,9 +862,11 @@ class Item extends Controller {
$body = cleanup_bbcode($body);
// Look for tags and linkify them
$results = linkify_tags($summary, ($uid) ? $uid : $profile_uid);
$results = linkify_tags($body, ($uid) ? $uid : $profile_uid);
$summary_tags = linkify_tags($summary, ($uid) ? $uid : $profile_uid);
$body_tags = linkify_tags($body, ($uid) ? $uid : $profile_uid);
$comment_tags = linkify_tags($hidden_mentions, ($uid) ? $uid : $profile_uid);
foreach ( [ $summary_tags, $body_tags, $comment_tags ] as $results ) {
if ($results) {
@ -879,6 +879,19 @@ class Item extends Controller {
foreach ($results as $result) {
$success = $result['success'];
if ($success['replaced']) {
// suppress duplicate mentions/tags
$already_tagged = false;
foreach ($post_tags as $pt) {
if ($pt['term'] === $success['term'] && $pt['url'] === $success['url'] && intval($pt['ttype']) === intval($success['termtype'])) {
$already_tagged = true;
break;
}
}
if ($already_tagged) {
continue;
}
$post_tags[] = array(
'uid' => $profile_uid,
'ttype' => $success['termtype'],
@ -909,6 +922,7 @@ class Item extends Controller {
}
}
}
}
/**

View file

@ -16,7 +16,7 @@ use Zotlabs\Daemon\Master;
* @brief This file defines some global constants and includes the central App class.
*/
define ( 'STD_VERSION', '20.05.12' );
define ( 'STD_VERSION', '20.05.14' );
define ( 'ZOT_REVISION', '6.0' );
define ( 'DB_UPDATE_VERSION', 1239 );

View file

@ -356,13 +356,13 @@ function commentInsert(obj, id) {
}
function commentAuthors(id) {
var auths = $("#thread-authors-" + id).html();
if(typeof(auths) != 'undefined') {
var tmpStr = $("#comment-edit-text-" + id).val();
if(tmpStr == '') {
$("#comment-edit-text-" + id).val(auths);
}
}
$("#hidden-mentions-" + id).val($("#thread-authors-" + id).html());
// if(typeof(auths) != 'undefined') {
// var tmpStr = $("#comment-edit-text-" + id).val();
// if(tmpStr == '') {
// $("#comment-edit-text-" + id).val(auths);
// }
// }
}

View file

@ -13,6 +13,7 @@
<input type="hidden" name="return" value="{{$return_path}}" />
<input type="hidden" name="jsreload" value="{{$jsreload}}" />
<input type="hidden" name="preview" id="comment-preview-inp-{{$id}}" value="0" />
<input type="hidden" name="hidden_mentions" id="hidden-mentions-{{$id}}" value="" />
{{if $anoncomments && ! $observer}}
<div id="comment-edit-anon-{{$id}}" style="display: none;" >
{{include file="field_input.tpl" field=$anonname}}