"remote self" should work now with the addons
authorMichael <heluecht@pirati.ca>
Wed, 6 Sep 2017 16:16:33 +0000 (16:16 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 6 Sep 2017 16:16:33 +0000 (16:16 +0000)
appnet/appnet.php
blogger/blogger.php
buffer/buffer.php
diaspora/diaspora.php
libertree/libertree.php
pumpio/pumpio.php
statusnet/statusnet.php
tumblr/tumblr.php
twitter/twitter.php
unicode_smilies/unicode_smilies.php
wppost/wppost.php

index fff1cc73df5daf65742bc78b2ec80a13a02d85a6..151a81ee495735c2ccfc6008ffc4f18ab191ce12 100644 (file)
@@ -296,7 +296,7 @@ function appnet_post_local(&$a,&$b) {
                $appnet_enable = (($appnet_post && x($_REQUEST,'appnet_enable')) ? intval($_REQUEST['appnet_enable']) : 0);
 
                // if API is used, default to the chosen settings
-               if($_REQUEST['api_source'] && intval(get_pconfig(local_user(),'appnet','post_by_default')))
+               if($b['api_source'] && intval(get_pconfig(local_user(),'appnet','post_by_default')))
                        $appnet_enable = 1;
 
                if(! $appnet_enable)
index 87f58859fd171b6ce877a1e9b903a2a2c43a9504..892e8a452e830587e2ca9be7e42da3697a66ae83 100755 (executable)
@@ -141,7 +141,7 @@ function blogger_post_local(&$a,&$b) {
 
        $bl_enable = (($bl_post && x($_REQUEST,'blogger_enable')) ? intval($_REQUEST['blogger_enable']) : 0);
 
-       if($_REQUEST['api_source'] && intval(get_pconfig(local_user(),'blogger','post_by_default')))
+       if($b['api_source'] && intval(get_pconfig(local_user(),'blogger','post_by_default')))
                $bl_enable = 1;
 
     if(! $bl_enable)
index 0b92144b7db99ea9d9fad5b870e7df03f7e93004..ca33708c831e191228d43c2964de67aad8a84226 100644 (file)
@@ -210,21 +210,25 @@ function buffer_settings_post(&$a,&$b) {
 
 function buffer_post_local(&$a,&$b) {
 
-       if((! local_user()) || (local_user() != $b['uid']))
+       if (!local_user() || (local_user() != $b['uid'])) {
                return;
+       }
 
        $buffer_post   = intval(get_pconfig(local_user(),'buffer','post'));
 
        $buffer_enable = (($buffer_post && x($_REQUEST,'buffer_enable')) ? intval($_REQUEST['buffer_enable']) : 0);
 
-       if($_REQUEST['api_source'] && intval(get_pconfig(local_user(),'buffer','post_by_default')))
+       if ($b['api_source'] && intval(get_pconfig(local_user(),'buffer','post_by_default'))) {
                $buffer_enable = 1;
+       }
 
-       if(! $buffer_enable)
+       if (!$buffer_enable) {
                return;
+       }
 
-       if(strlen($b['postopts']))
+       if (strlen($b['postopts'])) {
                $b['postopts'] .= ',';
+       }
 
        $b['postopts'] .= 'buffer';
 }
index 09d8f1148d468852177b35dc8092a34b74a6e58c..f637f468ed8d7a75f0ef518dad13a4a6e8d9b560 100755 (executable)
@@ -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';
 }
 
 
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';
 }
 
 
index 8d11c02856dc9a7587ea9939e11b1cf41ce563fa..f70801a85d1b09ab12f0be4693b81f4af80967e5 100644 (file)
@@ -349,23 +349,27 @@ function pumpio_settings_post(&$a,&$b) {
        }
 }
 
-function pumpio_post_local(&$a,&$b) {
+function pumpio_post_local(&$a, &$b) {
 
-       if((! local_user()) || (local_user() != $b['uid']))
+       if (!local_user() || (local_user() != $b['uid'])) {
                return;
+       }
 
-       $pumpio_post   = intval(get_pconfig(local_user(),'pumpio','post'));
+       $pumpio_post   = intval(get_pconfig(local_user(), 'pumpio', 'post'));
 
        $pumpio_enable = (($pumpio_post && x($_REQUEST,'pumpio_enable')) ? intval($_REQUEST['pumpio_enable']) : 0);
 
-       if($_REQUEST['api_source'] && intval(get_pconfig(local_user(),'pumpio','post_by_default')))
+       if ($b['api_source'] && intval(get_pconfig(local_user(), 'pumpio', 'post_by_default'))) {
                $pumpio_enable = 1;
+       }
 
-       if(! $pumpio_enable)
+       if (!$pumpio_enable) {
                return;
+       }
 
-       if(strlen($b['postopts']))
+       if (strlen($b['postopts'])) {
                $b['postopts'] .= ',';
+       }
 
        $b['postopts'] .= 'pumpio';
 }
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) {
index 5685ed4b3bf02fc0e7e2fed2e45e78fea5acf828..50530401d223df7fd8091d755e77ba8e8ed7b826 100644 (file)
@@ -273,31 +273,38 @@ function tumblr_settings_post(&$a,&$b) {
 
 }
 
-function tumblr_post_local(&$a,&$b) {
+function tumblr_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;
+       }
 
        $tmbl_post   = intval(get_pconfig(local_user(),'tumblr','post'));
 
        $tmbl_enable = (($tmbl_post && x($_REQUEST,'tumblr_enable')) ? intval($_REQUEST['tumblr_enable']) : 0);
 
-       if($_REQUEST['api_source'] && intval(get_pconfig(local_user(),'tumblr','post_by_default')))
+       if ($b['api_source'] && intval(get_pconfig(local_user(),'tumblr','post_by_default'))) {
                $tmbl_enable = 1;
+       }
 
-       if(! $tmbl_enable)
+       if (!$tmbl_enable) {
                return;
+       }
 
-       if(strlen($b['postopts']))
+       if (strlen($b['postopts'])) {
                $b['postopts'] .= ',';
+       }
+
        $b['postopts'] .= 'tumblr';
 }
 
index 76b92ac811f82733ead1fe7a9efc23ea7d30ccf2..7272957ca6e7294c7612ea0abdfcb0b4e9fe3849 100644 (file)
@@ -334,27 +334,33 @@ function twitter_settings(&$a,&$s) {
 }
 
 
-function twitter_post_local(&$a,&$b) {
+function twitter_post_local(&$a, &$b) {
 
-       if($b['edit'])
+       if ($b['edit']) {
                return;
+       }
 
-       if((local_user()) && (local_user() == $b['uid']) && (! $b['private']) && (! $b['parent']) ) {
+       if (!local_user() || (local_user() != $b['uid'])) {
+               return;
+       }
 
-               $twitter_post = intval(get_pconfig(local_user(),'twitter','post'));
-               $twitter_enable = (($twitter_post && x($_REQUEST,'twitter_enable')) ? intval($_REQUEST['twitter_enable']) : 0);
+       $twitter_post = intval(get_pconfig(local_user(), 'twitter', 'post'));
+       $twitter_enable = (($twitter_post && x($_REQUEST, 'twitter_enable')) ? intval($_REQUEST['twitter_enable']) : 0);
 
-               // if API is used, default to the chosen settings
-               if($_REQUEST['api_source'] && intval(get_pconfig(local_user(),'twitter','post_by_default')))
-                       $twitter_enable = 1;
+       // if API is used, default to the chosen settings
+       if ($b['api_source'] && intval(get_pconfig(local_user(), 'twitter', 'post_by_default'))) {
+               $twitter_enable = 1;
+       }
 
-       if(! $twitter_enable)
+       if (!$twitter_enable) {
                return;
+       }
 
-       if(strlen($b['postopts']))
+       if (strlen($b['postopts'])) {
                $b['postopts'] .= ',';
-               $b['postopts'] .= 'twitter';
        }
+
+       $b['postopts'] .= 'twitter';
 }
 
 function twitter_action($a, $uid, $pid, $action) {
index 0c941a0cb4ac7baa7220001fc49d26b6a742aea4..4ecea0c53c26f72084b0335e95eace53519521fc 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  * Name: Unicode Smilies
- * Description: Smilies based on the unicode emojis
+ * Description: Smilies based on the unicode emojis - On Linux use https://github.com/eosrei/emojione-color-font to see them in color
  * Version: 1.0
  * Author: Michael Vogel <http://pirati.ca/profile/heluecht>
  */
index 10437a06656e403e977a508011ccf56e3df2f714..fc9244af6ee72193d8b9e0aee060753ff4ebcf2b 100755 (executable)
@@ -149,38 +149,39 @@ function wppost_settings_post(&$a,&$b) {
 
 }
 
-function wppost_post_local(&$a,&$b) {
+function wppost_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;
        }
 
-    $wp_post   = intval(get_pconfig(local_user(),'wppost','post'));
+       $wp_post   = intval(get_pconfig(local_user(),'wppost','post'));
 
        $wp_enable = (($wp_post && x($_REQUEST,'wppost_enable')) ? intval($_REQUEST['wppost_enable']) : 0);
 
-       if($_REQUEST['api_source'] && intval(get_pconfig(local_user(),'wppost','post_by_default'))) {
+       if ($b['api_source'] && intval(get_pconfig(local_user(),'wppost','post_by_default'))) {
                $wp_enable = 1;
        }
 
-    if(! $wp_enable) {
-       return;
-    }
+       if (!$wp_enable) {
+               return;
+       }
 
-    if(strlen($b['postopts'])) {
-       $b['postopts'] .= ',';
-    }
-    $b['postopts'] .= 'wppost';
+       if (strlen($b['postopts'])) {
+               $b['postopts'] .= ',';
+       }
+
+       $b['postopts'] .= 'wppost';
 }