From: Thomas Willingham Date: Tue, 10 Jul 2012 04:05:57 +0000 (+0100) Subject: Fix Libertree for new 'source' requirement of API X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8dad32c81ecd052325e3d7b4e4ceffe958d32b2d;p=friendica-addons.git Fix Libertree for new 'source' requirement of API --- diff --git a/libertree/libertree.php b/libertree/libertree.php index c117fa81..0e7e1a81 100755 --- a/libertree/libertree.php +++ b/libertree/libertree.php @@ -153,8 +153,8 @@ function libertree_send(&$a,&$b) { $ltree_api_token = get_pconfig($b['uid'],'libertree','libertree_api_token'); $ltree_url = get_pconfig($b['uid'],'libertree','libertree_url'); $ltree_blog = "$ltree_url/api/v1/posts/create/?token=$ltree_api_token"; - - if($ltree_url && $ltree_api_token && $ltree_blog) { + $ltree_source = "Friendica"; + if($ltree_url && $ltree_api_token && $ltree_blog && $ltree_source) { require_once('include/bb2diaspora.php'); $tag_arr = array(); @@ -171,7 +171,6 @@ function libertree_send(&$a,&$b) { $title = $b['title']; $body = $b['body']; - // Insert a newline before and after a quote $body = str_ireplace("[quote", "\n\n[quote", $body); $body = str_ireplace("[/quote]", "[/quote]\n\n", $body); @@ -194,9 +193,11 @@ function libertree_send(&$a,&$b) { // Adding the title if(strlen($title)) $body = "## ".html_entity_decode($title)."\n\n".$body; + $params = array( - 'text' => $body + 'text' => $body, + 'source' => $ltree_source // 'token' => $ltree_api_token );