mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +00:00
UserClearNewTalkNotification: Only require a UserIdentity
Bug: T253435 Change-Id: I5e0d7a6300dfd6acda754e6334a6e3f58900d753
This commit is contained in:
parent
c56f992a72
commit
37cde0b9f2
|
@ -1406,12 +1406,13 @@ class EchoHooks {
|
|||
/**
|
||||
* Handler for UserClearNewTalkNotification hook.
|
||||
* @see https://www.mediawiki.org/wiki/Manual:Hooks/UserClearNewTalkNotification
|
||||
* @param User $user User whose talk page notification should be marked as read
|
||||
* @param UserIdentity $user User whose talk page notification should be marked as read
|
||||
*/
|
||||
public static function onUserClearNewTalkNotification( User $user ) {
|
||||
if ( !$user->isAnon() ) {
|
||||
DeferredUpdates::addCallableUpdate( function () use ( $user ) {
|
||||
MWEchoNotifUser::newFromUser( $user )->clearUserTalkNotifications();
|
||||
public static function onUserClearNewTalkNotification( UserIdentity $user ) {
|
||||
if ( $user->isRegistered() ) {
|
||||
$userObj = User::newFromIdentity( $user );
|
||||
DeferredUpdates::addCallableUpdate( function () use ( $userObj ) {
|
||||
MWEchoNotifUser::newFromUser( $userObj )->clearUserTalkNotifications();
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue