- $title = $this->getTitle();
- if ( !$oldid ) {
- // No oldid given, assuming latest revision; clear the timestamp.
- $notificationTimestamp = null;
- } elseif ( !$title->getNextRevisionID( $oldid ) ) {
- // Oldid given and is the latest revision for this title; clear the timestamp.
- $notificationTimestamp = null;
- } else {
- // See if the version marked as read is more recent than the one we're viewing.
- // Call load() if it wasn't called before due to $force.
- $this->load();
-
- if ( $this->timestamp === null ) {
- // This can only happen if $force is enabled.
- $notificationTimestamp = null;
- } else {
- // Oldid given and isn't the latest; update the timestamp.
- // This will result in no further notification emails being sent!
- $notificationTimestamp = Revision::getTimestampFromId( $title, $oldid );
- // We need to go one second to the future because of various strict comparisons
- // throughout the codebase
- $ts = new MWTimestamp( $notificationTimestamp );
- $ts->timestamp->add( new DateInterval( 'PT1S' ) );
- $notificationTimestamp = $ts->getTimestamp( TS_MW );
+ /**
+ * @deprecated since 1.27 Use the constructor, WatchedItemStore::getWatchedItem()
+ * or WatchedItemStore::loadWatchedItem()
+ */
+ public static function fromUserTitle( $user, $title, $checkRights = User::CHECK_USER_RIGHTS ) {
+ // wfDeprecated( __METHOD__, '1.27' );
+ return new self( $user, $title, self::DEPRECATED_USAGE_TIMESTAMP, (bool)$checkRights );
+ }