X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fitem.php;h=6da9ce88e8301ab991a7e594188baad3003bcf60;hb=ce4eb1deb0d862197757ae50313b457b6cc2e003;hp=ee532bd99b53e8db0f5d0e75e7bf6df98df5f6b0;hpb=9ca789b9529dceedc35f637804179e1034b3f1d9;p=friendica.git diff --git a/mod/item.php b/mod/item.php index ee532bd99b..6da9ce88e8 100644 --- a/mod/item.php +++ b/mod/item.php @@ -27,7 +27,7 @@ require_once('include/Scrape.php'); require_once('include/diaspora.php'); require_once('include/Contact.php'); -function item_post(App &$a) { +function item_post(App $a) { if((! local_user()) && (! remote_user()) && (! x($_REQUEST,'commenter'))) return; @@ -95,8 +95,7 @@ function item_post(App &$a) { $r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1", intval($parent) ); - } - elseif ($parent_uri && local_user()) { + } elseif ($parent_uri && local_user()) { // This is coming from an API source, and we are logged in $r = q("SELECT * FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", dbesc($parent_uri), @@ -141,16 +140,7 @@ function item_post(App &$a) { $thrparent = q("SELECT `author-link`, `network` FROM `item` WHERE `uri` = '%s' LIMIT 1", dbesc($thr_parent)); if (dbm::is_result($thrparent) AND ($thrparent[0]["network"] === NETWORK_OSTATUS) AND (normalise_link($parent_contact["url"]) != normalise_link($thrparent[0]["author-link"]))) { - $parent_contact = null; - - $r = q("SELECT * FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1", - dbesc(normalise_link($thrparent[0]["author-link"]))); - if (dbm::is_result($r)) { - $parent_contact = $r[0]; - $parent_contact["thumb"] = $parent_contact["photo"]; - $parent_contact["micro"] = $parent_contact["photo"]; - unset($parent_contact["id"]); - } + $parent_contact = get_contact_details_by_url($thrparent[0]["author-link"]); if (!isset($parent_contact["nick"])) { require_once("include/Scrape.php"); @@ -363,20 +353,6 @@ function item_post(App &$a) { $categories .= file_tag_list_to_file($filedas, 'file'); } - // Work around doubled linefeeds in Tinymce 3.5b2 - // First figure out if it's a status post that would've been - // created using tinymce. Otherwise leave it alone. - -/* $plaintext = (local_user() ? intval(get_pconfig(local_user(),'system','plaintext')) || !feature_enabled($profile_uid,'richtext') : 0); - if((! $parent) && (! $api_source) && (! $plaintext)) { - $body = fix_mce_lf($body); - }*/ - $plaintext = (local_user() ? !feature_enabled($profile_uid,'richtext') : 0); - if((! $parent) && (! $api_source) && (! $plaintext)) { - $body = fix_mce_lf($body); - } - - // get contact info for poster $author = null; @@ -569,12 +545,8 @@ function item_post(App &$a) { * add a statusnet style reply tag if the original post was from there * and we are replying, and there isn't one already */ - - if($parent AND ($parent_contact['network'] === NETWORK_OSTATUS)) { - if ($parent_contact['id'] != "") - $contact = '@'.$parent_contact['nick'].'+'.$parent_contact['id']; - else - $contact = '@[url='.$parent_contact['url'].']'.$parent_contact['nick'].'[/url]'; + if ($parent AND ($parent_contact['network'] == NETWORK_OSTATUS)) { + $contact = '@[url='.$parent_contact['url'].']'.$parent_contact['nick'].'[/url]'; if (!in_array($contact,$tags)) { $body = $contact.' '.$body; @@ -1080,7 +1052,7 @@ function item_post_return($baseurl, $api_source, $return_path) { -function item_content(App &$a) { +function item_content(App $a) { if ((! local_user()) && (! remote_user())) { return;