UserClearNewTalkNotification hook: Only guarantee a UserIdentity

Bug: T253435
Change-Id: Ia46b67ff284a8b9bc0d500e7b8536c2e84faef61
This commit is contained in:
DannyS712 2020-05-29 09:21:19 +00:00
parent 0eebd3ef55
commit 0eb1de24a7
3 changed files with 6 additions and 6 deletions

View file

@ -3731,7 +3731,7 @@ $action: Action being checked
'UserClearNewTalkNotification': Called when clearing the "You have new 'UserClearNewTalkNotification': Called when clearing the "You have new
messages!" message, return false to not delete it. messages!" message, return false to not delete it.
[&]$user: User (object) that will clear the message [&]$userIdentity: UserIdentiy for the user that will clear the message
$oldid: ID of the talk page revision being viewed (0 means the most recent one) $oldid: ID of the talk page revision being viewed (0 means the most recent one)
'UserEffectiveGroups': Called in User::getEffectiveGroups(). 'UserEffectiveGroups': Called in User::getEffectiveGroups().

View file

@ -4181,10 +4181,10 @@ class HookRunner implements
); );
} }
public function onUserClearNewTalkNotification( $user, $oldid ) { public function onUserClearNewTalkNotification( $userIdentity, $oldid ) {
return $this->container->run( return $this->container->run(
'UserClearNewTalkNotification', 'UserClearNewTalkNotification',
[ $user, $oldid ] [ $userIdentity, $oldid ]
); );
} }

View file

@ -2,7 +2,7 @@
namespace MediaWiki\User\Hook; namespace MediaWiki\User\Hook;
use User; use MediaWiki\User\UserIdentity;
/** /**
* @stable for implementation * @stable for implementation
@ -14,9 +14,9 @@ interface UserClearNewTalkNotificationHook {
* *
* @since 1.35 * @since 1.35
* *
* @param User $user User that will clear the message * @param UserIdentity $userIdentity User that will clear the message
* @param int $oldid ID of the talk page revision being viewed (0 means the most recent one) * @param int $oldid ID of the talk page revision being viewed (0 means the most recent one)
* @return bool|void True or no return value to continue or false to abort (not clear the message) * @return bool|void True or no return value to continue or false to abort (not clear the message)
*/ */
public function onUserClearNewTalkNotification( $user, $oldid ); public function onUserClearNewTalkNotification( $userIdentity, $oldid );
} }