mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 07:54:13 +00:00
Merge "Making sure notification counts are reset on user option changes"
This commit is contained in:
commit
f4d033b9b2
1
Echo.php
1
Echo.php
|
@ -175,6 +175,7 @@ $wgHooks['EchoGetBundleRules'][] = 'EchoHooks::onEchoGetBundleRules';
|
|||
$wgHooks['ArticleSaveComplete'][] = 'EchoHooks::onArticleSaved';
|
||||
$wgHooks['AddNewAccount'][] = 'EchoHooks::onAccountCreated';
|
||||
$wgHooks['ArticleRollbackComplete'][] = 'EchoHooks::onRollbackComplete';
|
||||
$wgHooks['UserSaveSettings'][] = 'EchoHooks::onUserSaveSettings';
|
||||
|
||||
// Disable ordinary user talk page email notifications
|
||||
$wgHooks['AbortEmailNotification'][] = 'EchoHooks::disableStandUserTalkEnotif';
|
||||
|
|
14
Hooks.php
14
Hooks.php
|
@ -697,4 +697,18 @@ class EchoHooks {
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handler for UserSaveSettings hook.
|
||||
* @see http://www.mediawiki.org/wiki/Manual:Hooks/UserSaveSettings
|
||||
* @param $user User whose settings were saved
|
||||
* @return bool true in all cases
|
||||
*/
|
||||
static function onUserSaveSettings( $user ) {
|
||||
// Reset the notification count since it may have changed due to user
|
||||
// option changes. This covers both explicit changes in the preferences
|
||||
// and changes made through the options API (since both call this hook).
|
||||
EchoNotificationController::resetNotificationCount( $user, DB_MASTER );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue