]> git.mxchange.org Git - friendica.git/commitdiff
fb addon only working from one site - more debug + simplify permission toggle
authorFriendika <info@friendika.com>
Sun, 13 Feb 2011 03:24:19 +0000 (19:24 -0800)
committerFriendika <info@friendika.com>
Sun, 13 Feb 2011 03:24:19 +0000 (19:24 -0800)
README
addon/facebook/facebook.php

diff --git a/README b/README
index e5c5e02d699d5d69f6606e82f8f44fa2a3f9aa89..36bd017923c4fe312850cecd0e198d4eec43c7fc 100644 (file)
--- a/README
+++ b/README
@@ -40,10 +40,8 @@ interaction you've grown to love, *and* was free to use, *and* was open source,
 *and* where your privacy is always under your control?
  
     And what if this social network could scale to encompass the entire 
-internet, and *not* require a central organisation to provide servers (in 
-exchange for selling your private information; and everything else they can
-find out about you - from logging all of your online activities and
-conversations)?
+internet, and *not* require a central organisation to provide servers? 
+(In exchange for peddling your private information behind your back.)
 
     Look no further. 
 
index 7bebb3b4fd205b60329065c466ca8a51bdb7b139..119ee2f3e5aaccba9e8d87bef3c3dfd595b27cca 100644 (file)
@@ -123,15 +123,12 @@ function facebook_content(&$a) {
 function facebook_install() {
        register_hook('post_local_end',  'addon/facebook/facebook.php', 'facebook_post_hook');
        register_hook('jot_networks',    'addon/facebook/facebook.php', 'facebook_jot_nets');
-       register_hook('post_local_start','addon/facebook/facebook.php', 'facebook_post_local');
-
 }
 
 
 function facebook_uninstall() {
        unregister_hook('post_local_end',  'addon/facebook/facebook.php', 'facebook_post_hook');
        unregister_hook('jot_networks',    'addon/facebook/facebook.php', 'facebook_jot_nets');
-       unregister_hook('post_local_start','addon/facebook/facebook.php', 'facebook_post_local');
 }
 
 
@@ -148,17 +145,6 @@ function facebook_jot_nets(&$a,&$b) {
        }
 }
 
-function facebook_post_local(&$a,&$b) {
-
-       if(! local_user())
-               return;
-
-       if((x($b,'facebook_enable')) && (intval($b['facebook_enable'])))
-               set_pconfig(local_user(),'facebook','enable','1');
-       else
-               del_pconfig(local_user(),'facebook','enable');
-}
-
 
 function facebook_post_hook(&$a,&$b) {
 
@@ -179,9 +165,10 @@ function facebook_post_hook(&$a,&$b) {
                        logger('facebook: have appid+secret');
 
                        $fb_post   = intval(get_pconfig(local_user(),'facebook','post'));
-                       $fb_enable = intval(get_pconfig(local_user(),'facebook','enable'));
+                       $fb_enable = (($fb_post && x($_POST,'facebook_enable')) ? intval($_POST['facebook_enable']) : 0);
                        $fb_token  = get_pconfig(local_user(),'facebook','access_token');
 
+                       logger('facebook: $fb_post: ' . $fb_post . ' $fb_enable: ' . $fb_enable . ' $fb_token: ' . $fb_token,LOGGER_DEBUG); 
                        if($fb_post && $fb_token && $fb_enable) {
                                logger('facebook: able to post');
                                require_once('library/facebook.php');