Merge "Convert CREDITS to list of all known git contributors"
[lhc/web/wiklou.git] / includes / api / ApiSetNotificationTimestamp.php
index a299e87..3412f38 100644 (file)
@@ -142,17 +142,10 @@ class ApiSetNotificationTimestamp extends ApiBase {
                                );
 
                                // Query the results of our update
-                               $timestamps = [];
-                               $lb = new LinkBatch( $pageSet->getTitles() );
-                               $res = $dbw->select(
-                                       'watchlist',
-                                       [ 'wl_namespace', 'wl_title', 'wl_notificationtimestamp' ],
-                                       [ 'wl_user' => $user->getId(), $lb->constructSet( 'wl', $dbw ) ],
-                                       __METHOD__
+                               $timestamps = $watchedItemStore->getNotificationTimestampsBatch(
+                                       $user,
+                                       $pageSet->getTitles()
                                );
-                               foreach ( $res as $row ) {
-                                       $timestamps[$row->wl_namespace][$row->wl_title] = $row->wl_notificationtimestamp;
-                               }
 
                                // Now, put the valid titles into the result
                                /** @var $title Title */
@@ -165,6 +158,9 @@ class ApiSetNotificationTimestamp extends ApiBase {
                                        ];
                                        if ( !$title->exists() ) {
                                                $r['missing'] = true;
+                                               if ( $title->isKnown() ) {
+                                                       $r['known'] = true;
+                                               }
                                        }
                                        if ( isset( $timestamps[$ns] ) && array_key_exists( $dbkey, $timestamps[$ns] ) ) {
                                                $r['notificationtimestamp'] = '';