From ac3e1829c55778cd56f87911584a38bc36e57b0a Mon Sep 17 00:00:00 2001 From: James Montalvo Date: Thu, 15 Nov 2018 18:09:11 -0600 Subject: [PATCH] Add BeforeResetNotificationTimestamp hook Allows prevention of clearing of notification timestamp when a user views a page in their watchlist. Change-Id: Id0af5c89c648ac6dce80012a1566426d5552942f --- includes/watcheditem/WatchedItemStore.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/watcheditem/WatchedItemStore.php b/includes/watcheditem/WatchedItemStore.php index a9bba7a9f0..4abe7af6e4 100644 --- a/includes/watcheditem/WatchedItemStore.php +++ b/includes/watcheditem/WatchedItemStore.php @@ -908,6 +908,10 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac return false; } + if ( ! Hooks::run( 'BeforeResetNotificationTimestamp', [ &$user, &$title, $force, &$oldid ] ) ) { + return false; + } + $item = null; if ( $force != 'force' ) { $item = $this->loadWatchedItem( $user, $title ); -- 2.20.1