Add BeforeResetNotificationTimestamp hook
authorJames Montalvo <edwin.j.montalvo@nasa.gov>
Fri, 16 Nov 2018 00:09:11 +0000 (18:09 -0600)
committerAddshore <addshorewiki@gmail.com>
Tue, 5 Feb 2019 08:36:21 +0000 (08:36 +0000)
Allows prevention of clearing of notification timestamp when a user
views a page in their watchlist.

Change-Id: Id0af5c89c648ac6dce80012a1566426d5552942f

includes/watcheditem/WatchedItemStore.php

index a9bba7a..4abe7af 100644 (file)
@@ -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 );