Mhutti1 has uploaded a new change for review. https://gerrit.wikimedia.org/r/260342
Change subject: HistoryRevisionTools and DiffRevisionTools no longer use $wgUser ...................................................................... HistoryRevisionTools and DiffRevisionTools no longer use $wgUser Modified insertThankLink to use passed in $user object instead of $wgUser. Bug: T121369 Change-Id: I1c9d1ff211bcec7815369509c5c50fad60d74643 --- M Thanks.hooks.php 1 file changed, 4 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Thanks refs/changes/42/260342/1 diff --git a/Thanks.hooks.php b/Thanks.hooks.php index bce2849..72604c1 100644 --- a/Thanks.hooks.php +++ b/Thanks.hooks.php @@ -40,9 +40,7 @@ * @param $oldRev Revision object of the "old" revision when viewing a diff * @return bool */ - public static function insertThankLink( $rev, &$links, $oldRev = null ) { - global $wgUser; - + public static function insertThankLink( $rev, &$links, $oldRev = null, $user ) { $recipientId = $rev->getUser(); $recipient = User::newFromId( $recipientId ); // Make sure Echo is turned on. @@ -51,9 +49,9 @@ // Exclude users who are blocked. // Check whether bots are allowed to receive thanks. if ( class_exists( 'EchoNotifier' ) - && !$wgUser->isAnon() - && $recipientId !== $wgUser->getId() - && !$wgUser->isBlocked() + && !$user->isAnon() + && $recipientId !== $user->getId() + && !$user->isBlocked() && self::canReceiveThanks( $recipient ) && !$rev->isDeleted( Revision::DELETED_TEXT ) && ( !$oldRev || $rev->getParentId() == $oldRev->getId() ) -- To view, visit https://gerrit.wikimedia.org/r/260342 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1c9d1ff211bcec7815369509c5c50fad60d74643 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Thanks Gerrit-Branch: master Gerrit-Owner: Mhutti1 <mhut...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits