diff options
author | Friendika <info@friendika.com> | 2011-04-26 17:17:34 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-04-26 17:17:34 -0700 |
commit | f97cfa79d9ee6f942ab8c8629f0a347ddf27cbd5 (patch) | |
tree | 732bc509cf689e7956a032cc84fe7f1c3201ffae /addon/facebook | |
parent | 242d4805d54d976ebc003fda5ac9d572b9dba104 (diff) | |
download | volse-hubzilla-f97cfa79d9ee6f942ab8c8629f0a347ddf27cbd5.tar.gz volse-hubzilla-f97cfa79d9ee6f942ab8c8629f0a347ddf27cbd5.tar.bz2 volse-hubzilla-f97cfa79d9ee6f942ab8c8629f0a347ddf27cbd5.zip |
tracking through issues with FB likes
Diffstat (limited to 'addon/facebook')
-rw-r--r-- | addon/facebook/facebook.php | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php index e3b15c528..b7244df95 100644 --- a/addon/facebook/facebook.php +++ b/addon/facebook/facebook.php @@ -405,7 +405,12 @@ function facebook_post_hook(&$a,&$b) { $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 || $b['private'])) { + + // post to facebook if it's a public post and we've ticked the 'post to Facebook' box, + // or it's a private message with facebook participants + // or it's a reply or likes action to an existing facebook post + + if($fb_post && $fb_token && ($fb_enable || $b['private'] || $reply)) { logger('facebook: able to post'); require_once('library/facebook.php'); require_once('include/bbcode.php'); @@ -444,10 +449,15 @@ function facebook_post_hook(&$a,&$b) { logger('Facebook post: msg=' . $msg, LOGGER_DATA); - $postvars = array( - 'access_token' => $fb_token, - 'message' => $msg - ); + if($likes) { + $postvars = array('access_token' => $fb_token); + } + else { + $postvars = array( + 'access_token' => $fb_token, + 'message' => $msg + ); + } if(($b['private']) && (! $b['parent'])) { $postvars['privacy'] = '{"value": "CUSTOM", "friends": "SOME_FRIENDS"'; |