aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-07-07 20:39:52 +0200
committerMario Vavti <mario@mariovavti.com>2016-07-07 20:39:52 +0200
commit0b2ad9deca89e7e267aeea114889f49ea93ed81d (patch)
tree98bc71e960967c9adf68c3c3a7b0443e003a3441
parent227320f6f01dec264de820863f971d3e92a486ff (diff)
parent3bee6543fbd339adf9b9993269b6a46bec27f05e (diff)
downloadvolse-hubzilla-0b2ad9deca89e7e267aeea114889f49ea93ed81d.tar.gz
volse-hubzilla-0b2ad9deca89e7e267aeea114889f49ea93ed81d.tar.bz2
volse-hubzilla-0b2ad9deca89e7e267aeea114889f49ea93ed81d.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev
-rw-r--r--Zotlabs/Daemon/Expire.php2
-rwxr-xr-xinclude/items.php27
2 files changed, 10 insertions, 19 deletions
diff --git a/Zotlabs/Daemon/Expire.php b/Zotlabs/Daemon/Expire.php
index 0ba83b240..215513e87 100644
--- a/Zotlabs/Daemon/Expire.php
+++ b/Zotlabs/Daemon/Expire.php
@@ -38,7 +38,7 @@ class Expire {
logger('site_expire: ' . $site_expire);
- $r = q("SELECT channel_id, channel_address, channel_pageflags, channel_expire_days from channel where true");
+ $r = q("SELECT channel_id, channel_system, channel_address, channel_expire_days from channel where true");
if ($r) {
foreach ($r as $rr) {
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);
}