jenkins-bot has submitted this change and it was merged.
Change subject: Use LinkTarget in EmailNotification::updateWatchlistTimestamp
......................................................................
Use LinkTarget in EmailNotification::updateWatchlistTimestamp
Change-Id: I3a59839b3ec4db42966afa1db5ad0252fafa8cb9
---
M includes/mail/EmailNotification.php
1 file changed, 11 insertions(+), 7 deletions(-)
Approvals:
Daniel Kinzler: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/mail/EmailNotification.php
b/includes/mail/EmailNotification.php
index 8bac6b8..9bda12c 100644
--- a/includes/mail/EmailNotification.php
+++ b/includes/mail/EmailNotification.php
@@ -74,11 +74,15 @@
/**
* @param User $editor The editor that triggered the update. Their
notification
* timestamp will not be updated(they have already seen it)
- * @param Title $title The title to update timestamps for
+ * @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, Title
$title, $timestamp ) {
+ public static function updateWatchlistTimestamp(
+ User $editor,
+ LinkTarget $linkTarget,
+ $timestamp
+ ) {
global $wgEnotifWatchlist, $wgShowUpdatedMarker;
if ( !$wgEnotifWatchlist && !$wgShowUpdatedMarker ) {
@@ -90,8 +94,8 @@
array( 'wl_user' ),
array(
'wl_user != ' . intval( $editor->getID() ),
- 'wl_namespace' => $title->getNamespace(),
- 'wl_title' => $title->getDBkey(),
+ 'wl_namespace' => $linkTarget->getNamespace(),
+ 'wl_title' => $linkTarget->getDBkey(),
'wl_notificationtimestamp IS NULL',
), __METHOD__
);
@@ -105,14 +109,14 @@
// Update wl_notificationtimestamp for all watching
users except the editor
$fname = __METHOD__;
$dbw->onTransactionIdle(
- function () use ( $dbw, $timestamp, $watchers,
$title, $fname ) {
+ function () use ( $dbw, $timestamp, $watchers,
$linkTarget, $fname ) {
$dbw->update( 'watchlist',
array( /* SET */
'wl_notificationtimestamp' => $dbw->timestamp( $timestamp )
), array( /* WHERE */
'wl_user' => $watchers,
- 'wl_namespace' =>
$title->getNamespace(),
- 'wl_title' =>
$title->getDBkey(),
+ 'wl_namespace' =>
$linkTarget->getNamespace(),
+ 'wl_title' =>
$linkTarget->getDBkey(),
), $fname
);
}
--
To view, visit https://gerrit.wikimedia.org/r/268130
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3a59839b3ec4db42966afa1db5ad0252fafa8cb9
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits