]> git.mxchange.org Git - friendica.git/commitdiff
warning message if Facebook post does not succeed. It happens quite a lot.
authorFriendika <info@friendika.com>
Thu, 2 Jun 2011 07:52:26 +0000 (00:52 -0700)
committerFriendika <info@friendika.com>
Thu, 2 Jun 2011 07:52:26 +0000 (00:52 -0700)
addon/facebook/facebook.php

index dc1aa02dd9f95660793c0e5abb47c24e4f934c45..00098a7ddcd62640e6eab9d1c7955da1c0740f69 100644 (file)
@@ -624,19 +624,23 @@ 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
+                                               notice( t('Facebook delivery failed.') . EOL);
+                                       }
+                                       
+                                       logger('Facebook post returns: ' . $x, LOGGER_DEBUG);
                                }
-                               
-                               logger('Facebook post returns: ' . $x, LOGGER_DEBUG);
-
                        }
                }
        }