aboutsummaryrefslogtreecommitdiffstats
path: root/addon/facebook/facebook.php
diff options
context:
space:
mode:
Diffstat (limited to 'addon/facebook/facebook.php')
-rw-r--r--addon/facebook/facebook.php27
1 files changed, 16 insertions, 11 deletions
diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php
index dc1aa02dd..3cc40330c 100644
--- a/addon/facebook/facebook.php
+++ b/addon/facebook/facebook.php
@@ -438,7 +438,7 @@ function facebook_post_hook(&$a,&$b) {
logger('facebook reply id=' . $reply);
}
- if($b['private'] && $reply == false) {
+ if($b['private'] && $reply === false) {
$allow_people = expand_acl($b['allow_cid']);
$allow_groups = expand_groups(expand_acl($b['allow_gid']));
$deny_people = expand_acl($b['deny_cid']);
@@ -624,19 +624,24 @@ function facebook_post_hook(&$a,&$b) {
// "test_mode" prevents anything from actually being posted.
// Otherwise, let's do it.
- if(! get_config('facebook','test_mode'))
+ if(! get_config('facebook','test_mode')) {
$x = post_url($url, $postvars);
- $retj = json_decode($x);
- if($retj->id) {
- q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d LIMIT 1",
- dbesc('fb::' . $retj->id),
- intval($b['id'])
- );
+ $retj = json_decode($x);
+ if($retj->id) {
+ q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d LIMIT 1",
+ dbesc('fb::' . $retj->id),
+ intval($b['id'])
+ );
+ }
+ else {
+ // FIXME queue the message so we can attempt to redeliver, see include/notifier.php and include/queue.php
+ if(! $likes)
+ notice( t('Facebook delivery failed.') . EOL);
+ }
+
+ logger('Facebook post returns: ' . $x, LOGGER_DEBUG);
}
-
- logger('Facebook post returns: ' . $x, LOGGER_DEBUG);
-
}
}
}