aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2016-12-08 11:16:23 -0800
committerzotlabs <mike@macgirvin.com>2016-12-08 11:16:23 -0800
commit5833bb3bd4b3feff0bfa80563cbbd123b80c8a24 (patch)
treebf4ad5c79685f9ecfed482bdbf297f3bd6c65638
parentb40707428130a927b27f595a875808d08588ff52 (diff)
downloadvolse-hubzilla-5833bb3bd4b3feff0bfa80563cbbd123b80c8a24.tar.gz
volse-hubzilla-5833bb3bd4b3feff0bfa80563cbbd123b80c8a24.tar.bz2
volse-hubzilla-5833bb3bd4b3feff0bfa80563cbbd123b80c8a24.zip
only update the 'changed' timestamp for recent item_store events
-rwxr-xr-xinclude/items.php24
1 files changed, 14 insertions, 10 deletions
diff --git a/include/items.php b/include/items.php
index 3bbd4cce3..0f1334df8 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1847,18 +1847,22 @@ function item_store($arr, $allow_exec = false, $deliver = true) {
call_hooks('post_remote_end',$arr);
- // update the commented timestamp on the parent
+ // update the commented timestamp on the parent - unless this is potentially a clone of an older item
+ // which we don't wish to bring to the surface. As the queue only holds deliveries for 3 days, it's
+ // suspected of being an older cloned item if the creation time is older than that.
- $z = q("select max(created) as commented from item where parent_mid = '%s' and uid = %d and item_delayed = 0 ",
- dbesc($arr['parent_mid']),
- intval($arr['uid'])
- );
+ if($arr['created'] > datetime_convert('','','now - 4 days')) {
+ $z = q("select max(created) as commented from item where parent_mid = '%s' and uid = %d and item_delayed = 0 ",
+ dbesc($arr['parent_mid']),
+ intval($arr['uid'])
+ );
- q("UPDATE item set commented = '%s', changed = '%s' WHERE id = %d",
- dbesc(($z) ? $z[0]['commented'] : (datetime_convert())),
- dbesc(datetime_convert()),
- intval($parent_id)
- );
+ q("UPDATE item set commented = '%s', changed = '%s' WHERE id = %d",
+ dbesc(($z) ? $z[0]['commented'] : (datetime_convert())),
+ dbesc(datetime_convert()),
+ intval($parent_id)
+ );
+ }
// If _creating_ a deleted item, don't propagate it further or send out notifications.