]> git.mxchange.org Git - friendica-addons.git/commitdiff
Facebook: Don't import empty messages
authorMichael <icarus@dabo.de>
Mon, 27 Feb 2012 15:30:53 +0000 (16:30 +0100)
committerMichael <icarus@dabo.de>
Mon, 27 Feb 2012 15:30:53 +0000 (16:30 +0100)
facebook/facebook.php

index 6b6c7f8447ec8e3cfc4373b409c0629870f864ed..c5f3a0b70f30f6c4950d828c8afd1af143b3dbc8 100755 (executable)
@@ -1016,12 +1016,17 @@ function fb_consume_stream($uid,$j,$wall = false) {
                                $datarray['private'] = 1;
                                $datarray['allow_cid'] = '<' . $uid . '>';
                        }
-                       
+
+                       if(trim($datarray['body']) == '') {
+                               logger('facebook: empty body');
+                               continue;
+                       }
+
                        $top_item = item_store($datarray);
                        $r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                                intval($top_item),
                                intval($uid)
-                       );                      
+                       );
                        if(count($r)) {
                                $orig_post = $r[0];
                                logger('fb: new top level item posted');