aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-11-25 18:37:22 +0000
committerMario <mario@mariovavti.com>2022-11-25 18:37:22 +0000
commit68ca8951a85973cf385f23b6147f51718563d7bf (patch)
treec0bcf7f22dbb8868d75d70a0e1fb432556fd869d
parent1e4718eae1c9ce647a34ed13d43d8a0bbe7c42af (diff)
downloadvolse-hubzilla-68ca8951a85973cf385f23b6147f51718563d7bf.tar.gz
volse-hubzilla-68ca8951a85973cf385f23b6147f51718563d7bf.tar.bz2
volse-hubzilla-68ca8951a85973cf385f23b6147f51718563d7bf.zip
mark unseen items seen after a certain amount of time (default 90 days)
-rw-r--r--Zotlabs/Daemon/Cron_daily.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/Zotlabs/Daemon/Cron_daily.php b/Zotlabs/Daemon/Cron_daily.php
index d1b74a032..71d3bc9ef 100644
--- a/Zotlabs/Daemon/Cron_daily.php
+++ b/Zotlabs/Daemon/Cron_daily.php
@@ -49,6 +49,22 @@ class Cron_daily {
dbesc('sse_id.%')
);
+ // Mark items seen after X days (default 90)
+
+ $r = dbq("select channel_id from channel where channel_removed = 0");
+ if ($r) {
+ foreach ($r as $rr) {
+ $mark_seen_days = get_pconfig($rr['channel_id'], 'system', 'mark_seen_days', 90);
+ q("UPDATE item SET item_unseen = 0 WHERE
+ uid = %d AND item_unseen = 1
+ AND created < %s - INTERVAL %s",
+ intval($rr['channel_id']),
+ db_utcnow(),
+ db_quoteinterval($mark_seen_days . ' DAY')
+ );
+ }
+ }
+
// Clean up emdedded content cache
q("DELETE FROM cache WHERE updated < %s - INTERVAL %s",
db_utcnow(),