* @author Luke Welling lwelling@wikimedia.org
*/
-use MediaWiki\Linker\LinkTarget;
use MediaWiki\MediaWikiServices;
/**
return $this->pageStatus;
}
- /**
- * @deprecated since 1.27 use WatchedItemStore::updateNotificationTimestamp directly
- *
- * @param User $editor The editor that triggered the update. Their notification
- * timestamp will not be updated(they have already seen it)
- * @param LinkTarget $linkTarget The link target of the title to update timestamps for
- * @param string $timestamp Set the update timestamp to this value
- *
- * @return int[] Array of user IDs
- */
- public static function updateWatchlistTimestamp(
- User $editor,
- LinkTarget $linkTarget,
- $timestamp
- ) {
- wfDeprecated( __METHOD__, '1.27' );
- $config = RequestContext::getMain()->getConfig();
- if ( !$config->get( 'EnotifWatchlist' ) && !$config->get( 'ShowUpdatedMarker' ) ) {
- return [];
- }
- return MediaWikiServices::getInstance()->getWatchedItemStore()->updateNotificationTimestamp(
- $editor,
- $linkTarget,
- $timestamp
- );
- }
-
/**
* Send emails corresponding to the user $editor editing the page $title.
*
&& $watchingUser->isEmailConfirmed()
&& $watchingUser->getId() != $userTalkId
&& !in_array( $watchingUser->getName(), $wgUsersNotifiedOnAllChanges )
- && !( $wgBlockDisablesLogin && $watchingUser->isBlocked() )
+ // @TODO Partial blocks should not prevent the user from logging in.
+ // see: https://phabricator.wikimedia.org/T208895
+ && !( $wgBlockDisablesLogin && $watchingUser->getBlock() )
+ && Hooks::run( 'SendWatchlistEmailNotification', [ $watchingUser, $title, $this ] )
) {
- if ( Hooks::run( 'SendWatchlistEmailNotification', [ $watchingUser, $title, $this ] ) ) {
- $this->compose( $watchingUser, self::WATCHLIST );
- }
+ $this->compose( $watchingUser, self::WATCHLIST );
}
}
}
wfDebug( __METHOD__ . ": user talk page edited, but user does not exist\n" );
} elseif ( $targetUser->getId() == $editor->getId() ) {
wfDebug( __METHOD__ . ": user edited their own talk page, no notification sent\n" );
- } elseif ( $wgBlockDisablesLogin && $targetUser->isBlocked() ) {
+ } elseif ( $wgBlockDisablesLogin && $targetUser->getBlock() ) {
+ // @TODO Partial blocks should not prevent the user from logging in.
+ // see: https://phabricator.wikimedia.org/T208895
wfDebug( __METHOD__ . ": talk page owner is blocked and cannot login, no notification sent\n" );
} elseif ( $targetUser->getOption( 'enotifusertalkpages' )
&& ( !$minorEdit || $targetUser->getOption( 'enotifminoredits' ) )
$keys['$PAGETITLE'] = $this->title->getPrefixedText();
$keys['$PAGETITLE_URL'] = $this->title->getCanonicalURL();
- $keys['$PAGEMINOREDIT'] = "\n" . ( $this->minorEdit ?
- wfMessage( 'enotif_minoredit' )->inContentLanguage()->text() : '' );
+ $keys['$PAGEMINOREDIT'] = $this->minorEdit ?
+ "\n\n" . wfMessage( 'enotif_minoredit' )->inContentLanguage()->text() :
+ '';
$keys['$UNWATCHURL'] = $this->title->getCanonicalURL( 'action=unwatch' );
if ( $this->editor->isAnon() ) {