aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php33
1 files changed, 10 insertions, 23 deletions
diff --git a/include/items.php b/include/items.php
index 84683273d..72f0896ad 100755
--- a/include/items.php
+++ b/include/items.php
@@ -449,11 +449,7 @@ function post_activity_item($arr) {
call_hooks('post_local_end', $arr);
Zotlabs\Daemon\Master::Summon(array('Notifier','activity',$post_id));
$ret['success'] = true;
- $r = q("select * from item where id = %d limit 1",
- intval($post_id)
- );
- if($r)
- $ret['activity'] = $r[0];
+ $ret['activity'] = $post['item'];
}
return $ret;
@@ -3290,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)
@@ -3316,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);
}