From 7c0c56d20b97f9005f175388b36128edfcd683b4 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 3 Apr 2015 12:37:29 +0200 Subject: [PATCH 1/2] The conversion of Repeated posts to markdown had a problem with a missing linefeed before the quote. --- include/bbcode.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index 63406689a1..ef791d9e7c 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -509,9 +509,7 @@ function bb_ShareAttributes($share, $simplehtml) { $text = $preshare.html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8').' '.$userid_compact.":
".$share[3]; break; case 3: // Diaspora - $headline = '
'; - $headline .= ''.html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8').$userid.':'; - $headline .= "
"; + $headline .= ''.html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8').$userid.':
'; $text = trim($share[1]); @@ -519,7 +517,7 @@ function bb_ShareAttributes($share, $simplehtml) { $text .= "
"; if (substr(normalise_link($link), 0, 19) != "http://twitter.com/") { - $text .= $headline.'
'.trim($share[3])."

"; + $text .= $headline.'
'.trim($share[3])."

"; if ($link != "") $text .= '
[l]'; From 796b13673d618c8eaab1104a25d0791a08220718 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 3 Apr 2015 13:06:19 +0200 Subject: [PATCH 2/2] Reshared posts weren't always recognized as such. --- include/diaspora.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/diaspora.php b/include/diaspora.php index f24487ae51..dd877112ba 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -2512,6 +2512,26 @@ function diaspora_is_reshare($body) { if ($body == $attributes) 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 = ""; preg_match("/profile='(.*?)'/ism", $attributes, $matches); if ($matches[1] != "")