]> git.mxchange.org Git - friendica.git/commitdiff
kill orphans
authorFriendika <info@friendika.com>
Sun, 6 Feb 2011 10:33:02 +0000 (02:33 -0800)
committerFriendika <info@friendika.com>
Sun, 6 Feb 2011 10:33:02 +0000 (02:33 -0800)
boot.php
include/items.php
update.php

index 4fc05f81a39ff0ae32cbef58d8fe3adbff9bbd47..4fc35be9bbb46f9899f1f7f2e9cd4465cc6384c5 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -2,8 +2,8 @@
 
 set_time_limit(0);
 
-define ( 'BUILD_ID',               1034   );
-define ( 'FRIENDIKA_VERSION',      '2.10.0904' );
+define ( 'BUILD_ID',               1035   );
+define ( 'FRIENDIKA_VERSION',      '2.10.0905' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.1'  );
 
 define ( 'EOL',                    "<br />\r\n"     );
index 359378ff7d9296ead60a69268c33f6975b804402..15fd262f4c0d35958f545f476d28c5698c893844 100644 (file)
@@ -144,7 +144,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0)
                `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, 
                `contact`.`id` AS `contact-id`, `contact`.`uid` AS `contact-uid`
                FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
-               WHERE `item`.`uid` = %d AND `item`.`visible` = 1 
+               WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`parent` != 0 
                AND `item`.`wall` = 1 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
                AND ( `item`.`edited` > '%s' OR `item`.`changed` > '%s' )
                $sql_extra
index f7bf9da1eda951242963212b824fa9a4ceeab81a..f909837470068b7c9f97220af56a3f9fde764934 100644 (file)
@@ -328,3 +328,17 @@ function update_1033() {
                `updated` DATETIME NOT NULL
                ) ENGINE = MYISAM DEFAULT CHARSET=utf8;");
 }
+
+
+function update_1034() {
+
+       // If you have any of these parent-less posts they can cause problems, and 
+       // we need to delete them. You can't see them anyway.
+       // Legitimate items will usually get re-created on the next 
+       // pull from the hub.
+       // But don't get rid of a post that may have just come in 
+       // and may not yet have the parent id set.
+
+       q("DELETE FROM `item` WHERE `parent` = 0 AND `created` < UTC_TIMESTAMP() - INTERVAL 2 MINUTE");
+
+}