diff --git a/classes/pref/filters.php b/classes/pref/filters.php index 54fc99bdc..7c255db4f 100755 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -333,6 +333,7 @@ class Pref_Filters extends Handler_Protected { $filter['name'] = $name[0]; $filter['param'] = $name[1]; $filter['checkbox'] = false; + $filter['last_triggered'] = $line["last_triggered"] ? make_local_datetime($line["last_triggered"], false) : null; $filter['enabled'] = $line["enabled"]; $filter['rules'] = $this->getfilterrules_concise($line['id']); diff --git a/classes/rssutils.php b/classes/rssutils.php index 923e98c82..b43e752da 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -781,6 +781,12 @@ class RSSUtils { $plugin->hook_filter_triggered($feed, $owner_uid, $article, $matched_filters, $matched_rules, $article_filters); } + $matched_filter_ids = implode(",", array_map(function($f) { return $f['id']; }, $matched_filters)); + + $fsth = $pdo->prepare("UPDATE ttrss_filters2 SET last_triggered = NOW() WHERE + id IN (?) AND owner_uid = ?"); + $fsth->execute([$matched_filter_ids, $owner_uid]); + if (Debug::get_loglevel() >= Debug::$LOG_EXTENDED) { Debug::log("matched filters: ", Debug::$LOG_VERBOSE); diff --git a/include/functions.php b/include/functions.php index 83cc72f80..2b6ad50e4 100755 --- a/include/functions.php +++ b/include/functions.php @@ -1,6 +1,6 @@