aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-05-23 17:24:15 -0700
committerfriendica <info@friendica.com>2013-05-23 17:24:15 -0700
commitc721c3a20e17783835672365ce56fe64876002c7 (patch)
tree23f3c5436e0aaab35fd5510b7bbb135f0dc5a46f /include/items.php
parentbb31e6bd6a7ad9c24d3537719a656c86de0e0ee5 (diff)
downloadvolse-hubzilla-c721c3a20e17783835672365ce56fe64876002c7.tar.gz
volse-hubzilla-c721c3a20e17783835672365ce56fe64876002c7.tar.bz2
volse-hubzilla-c721c3a20e17783835672365ce56fe64876002c7.zip
implement time travelling posts
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php
index 9abc2e330..ca8cbdfc0 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1486,6 +1486,15 @@ function item_store($arr,$force_parent = false) {
$arr['item_flags'] = $arr['item_flags'] | ITEM_UNSEEN;
+
+ // handle time travelers
+ // Allow a bit of fudge in case somebody just has a slightly slow/fast clock
+
+ $d1 = new DateTime('now +10 minutes');
+ $d2 = new DateTime($arr['created']);
+ if($d2 > $d1)
+ $arr['item_restrict'] = $arr['item_restrict'] | ITEM_DELAYED_PUBLISH;
+
$arr['llink'] = z_root() . '/display/' . $arr['mid'];
if(! $arr['plink'])