mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-25 19:43:16 +00:00
Fix Libertree for new 'source' requirement of API
This commit is contained in:
parent
4a5e30ec84
commit
8dad32c81e
1 changed files with 5 additions and 4 deletions
|
@ -153,8 +153,8 @@ function libertree_send(&$a,&$b) {
|
||||||
$ltree_api_token = get_pconfig($b['uid'],'libertree','libertree_api_token');
|
$ltree_api_token = get_pconfig($b['uid'],'libertree','libertree_api_token');
|
||||||
$ltree_url = get_pconfig($b['uid'],'libertree','libertree_url');
|
$ltree_url = get_pconfig($b['uid'],'libertree','libertree_url');
|
||||||
$ltree_blog = "$ltree_url/api/v1/posts/create/?token=$ltree_api_token";
|
$ltree_blog = "$ltree_url/api/v1/posts/create/?token=$ltree_api_token";
|
||||||
|
$ltree_source = "Friendica";
|
||||||
if($ltree_url && $ltree_api_token && $ltree_blog) {
|
if($ltree_url && $ltree_api_token && $ltree_blog && $ltree_source) {
|
||||||
|
|
||||||
require_once('include/bb2diaspora.php');
|
require_once('include/bb2diaspora.php');
|
||||||
$tag_arr = array();
|
$tag_arr = array();
|
||||||
|
@ -171,7 +171,6 @@ function libertree_send(&$a,&$b) {
|
||||||
|
|
||||||
$title = $b['title'];
|
$title = $b['title'];
|
||||||
$body = $b['body'];
|
$body = $b['body'];
|
||||||
|
|
||||||
// Insert a newline before and after a quote
|
// Insert a newline before and after a quote
|
||||||
$body = str_ireplace("[quote", "\n\n[quote", $body);
|
$body = str_ireplace("[quote", "\n\n[quote", $body);
|
||||||
$body = str_ireplace("[/quote]", "[/quote]\n\n", $body);
|
$body = str_ireplace("[/quote]", "[/quote]\n\n", $body);
|
||||||
|
@ -195,8 +194,10 @@ function libertree_send(&$a,&$b) {
|
||||||
if(strlen($title))
|
if(strlen($title))
|
||||||
$body = "## ".html_entity_decode($title)."\n\n".$body;
|
$body = "## ".html_entity_decode($title)."\n\n".$body;
|
||||||
|
|
||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
'text' => $body
|
'text' => $body,
|
||||||
|
'source' => $ltree_source
|
||||||
// 'token' => $ltree_api_token
|
// 'token' => $ltree_api_token
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue