Remove Revision::getRevisionText from ApiQueryDeletedrevs
[lhc/web/wiklou.git] / includes / api / ApiSetNotificationTimestamp.php
index ba4c6e8..3f6f14c 100644 (file)
@@ -77,8 +77,9 @@ class ApiSetNotificationTimestamp extends ApiBase {
                        $titles = $pageSet->getGoodTitles();
                        $title = reset( $titles );
                        if ( $title ) {
+                               // XXX $title isn't actually used, can we just get rid of the previous six lines?
                                $timestamp = MediaWikiServices::getInstance()->getRevisionStore()
-                                       ->getTimestampFromId( $title, $params['torevid'], IDBAccessObject::READ_LATEST );
+                                       ->getTimestampFromId( $params['torevid'], IDBAccessObject::READ_LATEST );
                                if ( $timestamp ) {
                                        $timestamp = $dbw->timestamp( $timestamp );
                                } else {
@@ -92,13 +93,14 @@ class ApiSetNotificationTimestamp extends ApiBase {
                        $titles = $pageSet->getGoodTitles();
                        $title = reset( $titles );
                        if ( $title ) {
-                               $revid = $title->getNextRevisionID( $params['newerthanrevid'], Title::GAID_FOR_UPDATE );
-                               if ( $revid ) {
-                                       $timestamp = $dbw->timestamp(
-                                               MediaWikiServices::getInstance()->getRevisionStore()->getTimestampFromId( $title, $revid )
-                                       );
-                               } else {
-                                       $timestamp = null;
+                               $timestamp = null;
+                               $rl = MediaWikiServices::getInstance()->getRevisionLookup();
+                               $currRev = $rl->getRevisionById( $params['newerthanrevid'], Title::READ_LATEST );
+                               if ( $currRev ) {
+                                       $nextRev = $rl->getNextRevision( $currRev, Title::READ_LATEST );
+                                       if ( $nextRev ) {
+                                               $timestamp = $dbw->timestamp( $nextRev->getTimestamp() );
+                                       }
                                }
                        }
                }