Merge pull request #1471 from annando/markdown-shared-posts
Diaspora/Libertree: problems with repeated posts
This commit is contained in:
commit
d0b925f95f
|
@ -509,9 +509,7 @@ function bb_ShareAttributes($share, $simplehtml) {
|
||||||
$text = $preshare.html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8').' '.$userid_compact.": <br />".$share[3];
|
$text = $preshare.html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8').' '.$userid_compact.": <br />".$share[3];
|
||||||
break;
|
break;
|
||||||
case 3: // Diaspora
|
case 3: // Diaspora
|
||||||
$headline = '<div class="shared_header">';
|
$headline .= '<b>'.html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8').$userid.':</b><br />';
|
||||||
$headline .= '<span><b>'.html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8').$userid.':</b></span>';
|
|
||||||
$headline .= "</div>";
|
|
||||||
|
|
||||||
$text = trim($share[1]);
|
$text = trim($share[1]);
|
||||||
|
|
||||||
|
@ -519,7 +517,7 @@ function bb_ShareAttributes($share, $simplehtml) {
|
||||||
$text .= "<hr />";
|
$text .= "<hr />";
|
||||||
|
|
||||||
if (substr(normalise_link($link), 0, 19) != "http://twitter.com/") {
|
if (substr(normalise_link($link), 0, 19) != "http://twitter.com/") {
|
||||||
$text .= $headline.'<blockquote class="shared_content">'.trim($share[3])."</blockquote><br />";
|
$text .= $headline.'<blockquote>'.trim($share[3])."</blockquote><br />";
|
||||||
|
|
||||||
if ($link != "")
|
if ($link != "")
|
||||||
$text .= '<br /><a href="'.$link.'">[l]</a>';
|
$text .= '<br /><a href="'.$link.'">[l]</a>';
|
||||||
|
|
|
@ -2512,6 +2512,26 @@ function diaspora_is_reshare($body) {
|
||||||
if ($body == $attributes)
|
if ($body == $attributes)
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
|
$guid = "";
|
||||||
|
preg_match("/guid='(.*?)'/ism", $attributes, $matches);
|
||||||
|
if ($matches[1] != "")
|
||||||
|
$guid = $matches[1];
|
||||||
|
|
||||||
|
preg_match('/guid="(.*?)"/ism', $attributes, $matches);
|
||||||
|
if ($matches[1] != "")
|
||||||
|
$guid = $matches[1];
|
||||||
|
|
||||||
|
if ($guid != "") {
|
||||||
|
$r = q("SELECT `contact-id` FROM `item` WHERE `guid` = '%s' AND `network` IN ('%s', '%s') LIMIT 1",
|
||||||
|
dbesc($guid), NETWORK_DFRN, NETWORK_DIASPORA);
|
||||||
|
if ($r) {
|
||||||
|
$ret= array();
|
||||||
|
$ret["root_handle"] = diaspora_handle_from_contact($r[0]["contact-id"]);
|
||||||
|
$ret["root_guid"] = $guid;
|
||||||
|
return($ret);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$profile = "";
|
$profile = "";
|
||||||
preg_match("/profile='(.*?)'/ism", $attributes, $matches);
|
preg_match("/profile='(.*?)'/ism", $attributes, $matches);
|
||||||
if ($matches[1] != "")
|
if ($matches[1] != "")
|
||||||
|
|
Loading…
Reference in a new issue