]> git.mxchange.org Git - friendica-addons.git/blobdiff - diaspora/diaspora.php
"remote self" should work now with the addons
[friendica-addons.git] / diaspora / diaspora.php
index aed80b88b0db2423d43ee7c97b9d5eb8e69e415a..f637f468ed8d7a75f0ef518dad13a4a6e8d9b560 100755 (executable)
@@ -142,7 +142,7 @@ function diaspora_settings(&$a,&$s) {
 
        $aspects = false;
 
-       if ($handle AND $password) {
+       if ($handle && $password) {
                $conn = new Diaspora_Connection($handle, $password);
                $conn->logIn();
                $aspects = $conn->getAspects();
@@ -233,28 +233,35 @@ function diaspora_settings_post(&$a,&$b) {
 
 function diaspora_post_local(&$a,&$b) {
 
-       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;
+       }
 
        $diaspora_post   = intval(get_pconfig(local_user(),'diaspora','post'));
 
        $diaspora_enable = (($diaspora_post && x($_REQUEST,'diaspora_enable')) ? intval($_REQUEST['diaspora_enable']) : 0);
 
-       if($_REQUEST['api_source'] && intval(get_pconfig(local_user(),'diaspora','post_by_default')))
+       if ($b['api_source'] && intval(get_pconfig(local_user(),'diaspora','post_by_default'))) {
                $diaspora_enable = 1;
+       }
 
-    if(! $diaspora_enable)
-       return;
+       if (!$diaspora_enable) {
+               return;
+       }
+
+       if (strlen($b['postopts'])) {
+               $b['postopts'] .= ',';
+       }
 
-    if(strlen($b['postopts']))
-       $b['postopts'] .= ',';
-     $b['postopts'] .= 'diaspora';
+       $b['postopts'] .= 'diaspora';
 }