From: Roland Häder Date: Thu, 22 Dec 2016 10:29:56 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/develop' into develop X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c0df692f5fc4eaadb322614069b2c7ed40453fa1;p=friendica.git Merge remote-tracking branch 'upstream/develop' into develop Signed-off-by: Roland Häder Conflicts: include/diaspora.php object/Item.php --- c0df692f5fc4eaadb322614069b2c7ed40453fa1 diff --cc include/diaspora.php index cfb624fdf2,2547de5149..00d11add52 --- a/include/diaspora.php +++ b/include/diaspora.php @@@ -2089,16 -2160,16 +2160,19 @@@ class Diaspora $created_at = datetime_convert("UTC", "UTC", notags(unxmlify($data->created_at))); $contact = self::allowed_contact_by_handle($importer, $author, false); -- if (!$contact) ++ if (!$contact) { return false; ++ } $message_id = self::message_exists($importer["uid"], $guid); -- if ($message_id) ++ if ($message_id) { return $message_id; ++ } $original_item = self::original_item($root_guid, $root_author, $author); -- if (!$original_item) ++ if (!$original_item) { return false; ++ } $orig_url = App::get_baseurl()."/display/".$original_item["guid"]; @@@ -2140,8 -2211,8 +2214,9 @@@ self::fetch_guid($datarray); $message_id = item_store($datarray); -- if ($message_id) ++ if ($message_id) { logger("Stored reshare ".$datarray["guid"]." with message id ".$message_id, LOGGER_DEBUG); ++ } return $message_id; } @@@ -2170,8 -2241,8 +2245,9 @@@ dbesc($target_guid), intval($importer["uid"]) ); -- if (!$r) ++ if (!$r) { return false; ++ } // Check if the sender is the thread owner $p = q("SELECT `id`, `author-link`, `origin` FROM `item` WHERE `id` = %d", @@@ -2194,7 -2265,7 +2270,7 @@@ logger("Deleted target ".$target_guid." (".$r[0]["id"].") from user ".$importer["uid"]." parent: ".$p[0]["id"], LOGGER_DEBUG); // Now check if the retraction needs to be relayed by us -- if($p[0]["origin"]) { ++ if ($p[0]["origin"]) { // notify others proc_run(PRIORITY_HIGH, "include/notifier.php", "drop", $r[0]["id"]); } @@@ -2355,15 -2436,15 +2441,17 @@@ * @return string the handle in the format user@domain.tld */ private function my_handle($contact) { -- if ($contact["addr"] != "") ++ if ($contact["addr"] != "") { return $contact["addr"]; ++ } // Normally we should have a filled "addr" field - but in the past this wasn't the case // So - just in case - we build the the address here. -- if ($contact["nickname"] != "") ++ if ($contact["nickname"] != "") { $nick = $contact["nickname"]; -- else ++ } else { $nick = $contact["nick"]; ++ } return $nick."@".substr(App::get_baseurl(), strpos(App::get_baseurl(),"://") + 3); } diff --cc mod/dfrn_confirm.php index 22d4c15358,e306176630..34c1213c3f --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@@ -425,18 -423,17 +425,18 @@@ function dfrn_confirm_post(&$a,$handsfr $r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1", intval($contact_id) ); - if (dbm::is_result($r)) + if (dbm::is_result($r)) { $contact = $r[0]; - else + } else { $contact = null; + } - if((isset($new_relation) && $new_relation == CONTACT_IS_FRIEND)) { + if ((isset($new_relation) && $new_relation == CONTACT_IS_FRIEND)) { - if(($contact) && ($contact['network'] === NETWORK_DIASPORA)) { + if (($contact) && ($contact['network'] === NETWORK_DIASPORA)) { require_once('include/diaspora.php'); - $ret = diaspora::send_share($user[0],$r[0]); + $ret = Diaspora::send_share($user[0],$r[0]); logger('share returns: ' . $ret); } diff --cc object/Item.php index e60344f7d3,41821e5388..85750c4f52 --- a/object/Item.php +++ b/object/Item.php @@@ -38,9 -38,9 +38,9 @@@ class Item extends BaseObject $this->set_template('wall'); $this->toplevel = ($this->get_id() == $this->get_data_value('parent')); -- if(is_array($_SESSION['remote'])) { -- foreach($_SESSION['remote'] as $visitor) { -- if($visitor['cid'] == $this->get_data_value('contact-id')) { ++ if (is_array($_SESSION['remote'])) { ++ foreach ($_SESSION['remote'] as $visitor) { ++ if ($visitor['cid'] == $this->get_data_value('contact-id')) { $this->visiting = true; break; } @@@ -349,83 -334,81 +349,83 @@@ // Diaspora isn't able to do likes on comments - but red does if (($item["item_network"] == NETWORK_DIASPORA) AND ($indent == 'comment') AND - !diaspora::is_redmatrix($item["owner-link"]) AND isset($buttons["like"])) { - !Diaspora::is_redmatrix($item["owner-link"]) AND isset($buttons["like"])) ++ !Diaspora::is_redmatrix($item["owner-link"]) AND isset($buttons["like"])) { unset($buttons["like"]); + } // Diaspora doesn't has multithreaded comments - if (($item["item_network"] == NETWORK_DIASPORA) AND ($indent == 'comment')) + if (($item["item_network"] == NETWORK_DIASPORA) AND ($indent == 'comment')) { unset($comment); + } // Facebook can like comments - but it isn't programmed in the connector yet. - if (($item["item_network"] == NETWORK_FACEBOOK) AND ($indent == 'comment') AND isset($buttons["like"])) + if (($item["item_network"] == NETWORK_FACEBOOK) AND ($indent == 'comment') AND isset($buttons["like"])) { unset($buttons["like"]); + } $tmp_item = array( - 'template' => $this->get_template(), - - 'type' => implode("",array_slice(explode("/",$item['verb']),-1)), - 'tags' => $item['tags'], - 'hashtags' => $item['hashtags'], - 'mentions' => $item['mentions'], - 'txt_cats' => t('Categories:'), - 'txt_folders' => t('Filed under:'), - 'has_cats' => ((count($categories)) ? 'true' : ''), - 'has_folders' => ((count($folders)) ? 'true' : ''), - 'categories' => $categories, - 'folders' => $folders, - 'body' => $body_e, - 'text' => $text_e, - 'id' => $this->get_id(), - 'guid' => urlencode($item['guid']), - 'isevent' => $isevent, - 'attend' => $attend, - 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])), - 'olinktitle' => sprintf( t('View %s\'s profile @ %s'), htmlentities($this->get_owner_name()), ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])), - 'to' => t('to'), - 'via' => t('via'), - 'wall' => t('Wall-to-Wall'), - 'vwall' => t('via Wall-To-Wall:'), - 'profile_url' => $profile_link, + 'template' => $this->get_template(), + 'type' => implode("",array_slice(explode("/",$item['verb']),-1)), + 'tags' => $item['tags'], + 'hashtags' => $item['hashtags'], + 'mentions' => $item['mentions'], + 'txt_cats' => t('Categories:'), + 'txt_folders' => t('Filed under:'), + 'has_cats' => ((count($categories)) ? 'true' : ''), + 'has_folders' => ((count($folders)) ? 'true' : ''), + 'categories' => $categories, + 'folders' => $folders, + 'body' => $body_e, + 'text' => $text_e, + 'id' => $this->get_id(), + 'guid' => urlencode($item['guid']), + 'isevent' => $isevent, + 'attend' => $attend, + 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])), + 'olinktitle' => sprintf( t('View %s\'s profile @ %s'), htmlentities($this->get_owner_name()), ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])), + 'to' => t('to'), + 'via' => t('via'), + 'wall' => t('Wall-to-Wall'), + 'vwall' => t('via Wall-To-Wall:'), + 'profile_url' => $profile_link, 'item_photo_menu' => item_photo_menu($item), - 'name' => $name_e, - 'thumb' => $a->remove_baseurl(proxy_url($item['author-thumb'], false, PROXY_SIZE_THUMB)), - 'osparkle' => $osparkle, - 'sparkle' => $sparkle, - 'title' => $title_e, - 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'), - 'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])), - 'app' => $item['app'], - 'created' => relative_date($item['created']), - 'lock' => $lock, - 'location' => $location_e, - 'indent' => $indent, - 'shiny' => $shiny, - 'owner_url' => $this->get_owner_url(), - 'owner_photo' => $a->remove_baseurl(proxy_url($item['owner-thumb'], false, PROXY_SIZE_THUMB)), - 'owner_name' => htmlentities($owner_name_e), - 'plink' => get_plink($item), - 'edpost' => ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''), - 'isstarred' => $isstarred, - 'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''), - 'ignore' => ((feature_enabled($conv->get_profile_owner(),'ignore_posts')) ? $ignore : ''), - 'tagger' => $tagger, - 'filer' => ((feature_enabled($conv->get_profile_owner(),'filing')) ? $filer : ''), - 'drop' => $drop, - 'vote' => $buttons, - 'like' => $responses['like']['output'], - 'dislike' => $responses['dislike']['output'], - 'responses' => $responses, - 'switchcomment' => t('Comment'), - 'comment' => $comment, - 'previewing' => ($conv->is_preview() ? ' preview ' : ''), - 'wait' => t('Please wait'), - 'thread_level' => $thread_level, - 'postopts' => $langstr, - 'edited' => $edited, - 'network' => $item["item_network"], - 'network_name' => network_to_name($item['item_network'], $profile_link), + 'name' => $name_e, + 'thumb' => $a->remove_baseurl(proxy_url($item['author-thumb'], false, PROXY_SIZE_THUMB)), + 'osparkle' => $osparkle, + 'sparkle' => $sparkle, + 'title' => $title_e, + 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'), + 'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])), + 'app' => $item['app'], + 'created' => relative_date($item['created']), + 'lock' => $lock, + 'location' => $location_e, + 'indent' => $indent, + 'shiny' => $shiny, + 'owner_url' => $this->get_owner_url(), + 'owner_photo' => $a->remove_baseurl(proxy_url($item['owner-thumb'], false, PROXY_SIZE_THUMB)), + 'owner_name' => htmlentities($owner_name_e), + 'plink' => get_plink($item), + 'edpost' => ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''), + 'isstarred' => $isstarred, + 'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''), + 'ignore' => ((feature_enabled($conv->get_profile_owner(),'ignore_posts')) ? $ignore : ''), + 'tagger' => $tagger, + 'filer' => ((feature_enabled($conv->get_profile_owner(),'filing')) ? $filer : ''), + 'drop' => $drop, + 'vote' => $buttons, + 'like' => $responses['like']['output'], + 'dislike' => $responses['dislike']['output'], + 'responses' => $responses, + 'switchcomment' => t('Comment'), + 'comment' => $comment, + 'previewing' => ($conv->is_preview() ? ' preview ' : ''), + 'wait' => t('Please wait'), + 'thread_level' => $thread_level, + 'postopts' => $langstr, + 'edited' => $edited, + 'network' => $item["item_network"], + 'network_name' => network_to_name($item['item_network'], $profile_link), ); $arr = array('item' => $item, 'output' => $tmp_item);