]> git.mxchange.org Git - friendica-addons.git/blobdiff - libertree/libertree.php
"remote self" should work now with the addons
[friendica-addons.git] / libertree / libertree.php
index 56dc946c32a2c9f26a4ec3231185e7a4f0c181c9..c87a71043799d05626a705c77c27d74d6ae0c182 100755 (executable)
@@ -115,28 +115,35 @@ function libertree_post_local(&$a,&$b) {
 
        // This can probably be changed to allow editing by pointing to a different API endpoint
 
-       if($b['edit'])
+       if ($b['edit']) {
                return;
+       }
 
-       if((! local_user()) || (local_user() != $b['uid']))
+       if ((! local_user()) || (local_user() != $b['uid'])) {
                return;
+       }
 
-       if($b['private'] || $b['parent'])
+       if ($b['private'] || $b['parent']) {
                return;
+       }
 
        $ltree_post   = intval(get_pconfig(local_user(),'libertree','post'));
 
        $ltree_enable = (($ltree_post && x($_REQUEST,'libertree_enable')) ? intval($_REQUEST['libertree_enable']) : 0);
 
-       if($_REQUEST['api_source'] && intval(get_pconfig(local_user(),'libertree','post_by_default')))
+       if ($b['api_source'] && intval(get_pconfig(local_user(),'libertree','post_by_default'))) {
                $ltree_enable = 1;
+       }
 
-    if(! $ltree_enable)
-       return;
+       if (!$ltree_enable) {
+               return;
+       }
+
+       if (strlen($b['postopts'])) {
+               $b['postopts'] .= ',';
+       }
 
-    if(strlen($b['postopts']))
-       $b['postopts'] .= ',';
-     $b['postopts'] .= 'libertree';
+       $b['postopts'] .= 'libertree';
 }