Merge "Drop SessionManager::autoCreateUser(), deprecated in 1.27 and unused"
[lhc/web/wiklou.git] / includes / api / ApiSetNotificationTimestamp.php
index b81c5bf..41c207b 100644 (file)
@@ -108,10 +108,14 @@ class ApiSetNotificationTimestamp extends ApiBase {
                $result = [];
                if ( $params['entirewatchlist'] ) {
                        // Entire watchlist mode: Just update the thing and return a success indicator
-                       $watchedItemStore->setNotificationTimestampsForUser(
-                               $user,
-                               $timestamp
-                       );
+                       if ( is_null( $timestamp ) ) {
+                               $watchedItemStore->resetAllNotificationTimestampsForUser( $user );
+                       } else {
+                               $watchedItemStore->setNotificationTimestampsForUser(
+                                       $user,
+                                       $timestamp
+                               );
+                       }
 
                        $result['notificationtimestamp'] = is_null( $timestamp )
                                ? ''