]> git.mxchange.org Git - friendica-addons.git/blobdiff - statusnet/statusnet.php
"remote self" should work now with the addons
[friendica-addons.git] / statusnet / statusnet.php
index fd266ef17e68c4fd4ae71186110239498e6d3919..a004a6243cbc4c8c1aa7246b873d00b49f99f904 100644 (file)
@@ -428,26 +428,32 @@ function statusnet_settings(&$a,&$s) {
 }
 
 
-function statusnet_post_local(&$a,&$b) {
-       if($b['edit'])
+function statusnet_post_local(&$a, &$b) {
+       if ($b['edit']) {
                return;
+       }
 
-       if((local_user()) && (local_user() == $b['uid']) && (! $b['private'])) {
+       if (!local_user() || (local_user() != $b['uid'])) {
+               return;
+       }
 
-               $statusnet_post = get_pconfig(local_user(),'statusnet','post');
-               $statusnet_enable = (($statusnet_post && x($_REQUEST,'statusnet_enable')) ? intval($_REQUEST['statusnet_enable']) : 0);
+       $statusnet_post = get_pconfig(local_user(),'statusnet','post');
+       $statusnet_enable = (($statusnet_post && x($_REQUEST,'statusnet_enable')) ? intval($_REQUEST['statusnet_enable']) : 0);
 
-               // if API is used, default to the chosen settings
-               if($_REQUEST['api_source'] && intval(get_pconfig(local_user(),'statusnet','post_by_default')))
-                       $statusnet_enable = 1;
+       // if API is used, default to the chosen settings
+       if ($b['api_source'] && intval(get_pconfig(local_user(),'statusnet','post_by_default'))) {
+               $statusnet_enable = 1;
+       }
 
-               if(! $statusnet_enable)
-                       return;
+       if (!$statusnet_enable) {
+               return;
+       }
 
-               if(strlen($b['postopts']))
-                       $b['postopts'] .= ',';
-               $b['postopts'] .= 'statusnet';
+       if (strlen($b['postopts'])) {
+               $b['postopts'] .= ',';
        }
+
+       $b['postopts'] .= 'statusnet';
 }
 
 function statusnet_action($a, $uid, $pid, $action) {