diff options
author | Tobias Diekershoff <tobias.diekershoff@gmx.net> | 2011-06-07 20:03:58 +0200 |
---|---|---|
committer | Tobias Diekershoff <tobias.diekershoff@gmx.net> | 2011-06-07 20:03:58 +0200 |
commit | e036434b8a2dbd8594c0ac5ac7233f4700e4e475 (patch) | |
tree | 0d37048ec06d603e45fd9852f208478a89e84476 /addon | |
parent | 0e8b2092a0c30a8eb898a8f0e7130251300e8d47 (diff) | |
parent | c1b2e90e3720961c280f6378e48fda7bad7c3ad0 (diff) | |
download | volse-hubzilla-e036434b8a2dbd8594c0ac5ac7233f4700e4e475.tar.gz volse-hubzilla-e036434b8a2dbd8594c0ac5ac7233f4700e4e475.tar.bz2 volse-hubzilla-e036434b8a2dbd8594c0ac5ac7233f4700e4e475.zip |
Merge branch 'master' of git://github.com/friendika/friendika
Diffstat (limited to 'addon')
-rw-r--r-- | addon/facebook/facebook.php | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php index ac522aab6..657ba7dc2 100644 --- a/addon/facebook/facebook.php +++ b/addon/facebook/facebook.php @@ -640,7 +640,7 @@ function facebook_post_hook(&$a,&$b) { if(! $likes) { $s = serialize(array('url' => $url, 'item' => $b['id'], 'post' => $postvars)); q("INSERT INTO `queue` ( `network`, `cid`, `created`, `last`, `content`) - VALUES ( '%s', '%s', '%s', '%s') ", + VALUES ( '%s', %d, '%s', '%s', '%s') ", dbesc(NETWORK_FACEBOOK), intval($a->contact), dbesc(datetime_convert()), @@ -662,12 +662,20 @@ function facebook_post_hook(&$a,&$b) { function fb_queue_hook(&$a,&$b) { - require_once('include/queue_fn.php'); - if((! is_array($b)) || (! count($b))) + $qi = q("SELECT * FROM `queue` WHERE `network` = '%s'", + dbesc(NETWORK_FACEBOOK) + ); + if(! count($qi)) return; - foreach($b as $x) { - if($b['network'] !== NETWORK_FACEBOOK) + + require_once('include/queue_fn.php'); + + foreach($qi as $x) { + if($x['network'] !== NETWORK_FACEBOOK) continue; + + logger('facebook_queue: run'); + $r = q("SELECT `user`.* FROM `user` LEFT JOIN `contact` on `contact`.`uid` = `user`.`uid` WHERE `contact`.`self` = 1 AND `contact`.`id` = %d LIMIT 1", intval($x['cid']) @@ -698,7 +706,7 @@ function fb_queue_hook(&$a,&$b) { dbesc('fb::' . $retj->id), intval($item) ); - logger('facebook queue: success: ' . $j); + logger('facebook_queue: success: ' . $j); remove_queue_item($x['id']); } else { |