From 640d15dba548533fbda5d73d04db8f6896197026 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 12 Nov 2016 14:09:33 -0800 Subject: don't send notification for posts/comments on old conversations that were refetched after having expired. We'll accomplish this by limiting notifications to items posted within the last month. --- Zotlabs/Lib/Enotify.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Zotlabs/Lib/Enotify.php') diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index ffe2f0950..b6f4d3351 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -102,6 +102,10 @@ class Enotify { $title = $params['item']['title']; $body = $params['item']['body']; } + if($item['created'] < datetime_convert('UTC','UTC','now - 1 month')) { + logger('notification invoked for an old item which may have been refetched.',LOGGER_DEBUG,LOG_INFO); + return; + } } else { $title = $body = ''; -- cgit v1.2.3