X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdiaspora.php;h=2ff7a90cfbe677cc4eb92a880a4fb7be39bfb09d;hb=7e6598f2c01dc25b9420309dac1ec84160f21a03;hp=ce3d4ef00db1a817414fabff3a610cc51a4fd1cd;hpb=ea8cfed6a931913006cefbac22bc1e91b7e71580;p=friendica.git diff --git a/include/diaspora.php b/include/diaspora.php index ce3d4ef00d..2ff7a90cfb 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -2,41 +2,6 @@ /** * @file include/diaspora.php * @brief The implementation of the diaspora protocol - * - * Checklist: - * - * Checked: - * - send status - * - send comment - * - send like - * - send mail - * - send status retraction - * - send comment retraction on own post - * - send like retraction on own post - * - send comment retraction on diaspora post - * - send like retraction on diaspora post - * - receive status - * - receive reshare - * - receive comment - * - receive like - * - receive connect request - * - receive profile data - * - receive mail - * - receive comment retraction - * - receive like retraction - * - relay comment - * - relay like - * - relay comment retraction from diaspora - * - relay comment retraction from friendica - * - relay like retraction from diaspora - * - relay like retraction from friendica - * - send share - * - * Should work: - * - receive account deletion - * - send unshare - * - * Unchecked: */ require_once("include/items.php"); @@ -1945,8 +1910,13 @@ class diaspora { FROM `item` WHERE `id` = %d AND `visible` AND NOT `deleted` AND `body` != '' LIMIT 1", intval($item_id)); - if ($r) + if ($r) { + // If it is a reshared post from another network then reformat to avoid display problems with two share elements + if (self::is_reshare($r[0]["body"], false)) + $r[0]["body"] = diaspora2bb(bb2diaspora($r[0]["body"])); + return $r[0]; + } } } @@ -2580,7 +2550,7 @@ class diaspora { // Skip if it isn't a pure repeated messages // Does it start with a share? - if (strpos($body, "[share") > 0) + if ((strpos($body, "[share") > 0) AND $complete) return(false); // Does it end with a share? @@ -3122,12 +3092,6 @@ class diaspora { */ public static function store_like_signature($contact, $post_id) { - $enabled = intval(get_config('system','diaspora_enabled')); - if (!$enabled) { - logger('Diaspora support disabled, not storing like signature', LOGGER_DEBUG); - return false; - } - // Is the contact the owner? Then fetch the private key if (!$contact['self'] OR ($contact['uid'] == 0)) { logger("No owner post, so not storing signature", LOGGER_DEBUG); @@ -3191,12 +3155,6 @@ class diaspora { return false; } - $enabled = intval(get_config('system','diaspora_enabled')); - if (!$enabled) { - logger('Diaspora support disabled, not storing comment signature', LOGGER_DEBUG); - return false; - } - $contact["uprvkey"] = $uprvkey; $message = self::construct_comment($item, $contact);