aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-07-11 17:45:10 -0700
committerredmatrix <git@macgirvin.com>2016-07-11 17:45:10 -0700
commita01baab4f0dc1654dfe2d2cc6fc78e5c3c8d9f4e (patch)
treea0c5e55621e24f0fce38a827613fc16d6b56f199 /include/items.php
parent71b001fdb7f4c900f6e7ff15a29952d6dc82c1fc (diff)
parent17c3e12eabf93fe76061af0b97d25c6a9d080025 (diff)
downloadvolse-hubzilla-a01baab4f0dc1654dfe2d2cc6fc78e5c3c8d9f4e.tar.gz
volse-hubzilla-a01baab4f0dc1654dfe2d2cc6fc78e5c3c8d9f4e.tar.bz2
volse-hubzilla-a01baab4f0dc1654dfe2d2cc6fc78e5c3c8d9f4e.zip
Merge branch 'dev' into perms
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php27
1 files changed, 9 insertions, 18 deletions
diff --git a/include/items.php b/include/items.php
index 48358c0e4..72f0896ad 100755
--- a/include/items.php
+++ b/include/items.php
@@ -3286,15 +3286,17 @@ function item_expire($uid,$days) {
$item_normal = item_normal();
- $r = q("SELECT * FROM `item`
- WHERE `uid` = %d
- AND `created` < %s - INTERVAL %s
- AND `id` = `parent`
- $sql_extra
+ $r = q("SELECT id FROM item
+ WHERE uid = %d
+ AND created < %s - INTERVAL %s
AND item_retained = 0
- $item_normal LIMIT $expire_limit ",
+ AND item_thread_top = 1
+ AND resource_type = ''
+ AND item_starred = 0
+ $sql_extra $item_normal LIMIT $expire_limit ",
intval($uid),
- db_utcnow(), db_quoteinterval(intval($days).' DAY')
+ db_utcnow(),
+ db_quoteinterval(intval($days).' DAY')
);
if(! $r)
@@ -3312,17 +3314,6 @@ function item_expire($uid,$days) {
continue;
}
- // Only expire posts, not photos and photo comments
-
- if($item['resource_type'] === 'photo') {
- retain_item($item['id']);
- continue;
- }
- if(intval($item['item_starred'])) {
- retain_item($item['id']);
- continue;
- }
-
drop_item($item['id'],false);
}