tracking through issues with FB likes

This commit is contained in:
Friendika 2011-04-26 17:17:34 -07:00
parent 242d4805d5
commit f97cfa79d9

View file

@ -405,7 +405,12 @@ function facebook_post_hook(&$a,&$b) {
$fb_token = get_pconfig(local_user(),'facebook','access_token'); $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); 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'); logger('facebook: able to post');
require_once('library/facebook.php'); require_once('library/facebook.php');
require_once('include/bbcode.php'); require_once('include/bbcode.php');
@ -444,10 +449,15 @@ function facebook_post_hook(&$a,&$b) {
logger('Facebook post: msg=' . $msg, LOGGER_DATA); logger('Facebook post: msg=' . $msg, LOGGER_DATA);
$postvars = array( if($likes) {
'access_token' => $fb_token, $postvars = array('access_token' => $fb_token);
'message' => $msg }
); else {
$postvars = array(
'access_token' => $fb_token,
'message' => $msg
);
}
if(($b['private']) && (! $b['parent'])) { if(($b['private']) && (! $b['parent'])) {
$postvars['privacy'] = '{"value": "CUSTOM", "friends": "SOME_FRIENDS"'; $postvars['privacy'] = '{"value": "CUSTOM", "friends": "SOME_FRIENDS"';