mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 16:04:35 +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['ArticleSaveComplete'][] = 'EchoHooks::onArticleSaved';
|
||||||
$wgHooks['AddNewAccount'][] = 'EchoHooks::onAccountCreated';
|
$wgHooks['AddNewAccount'][] = 'EchoHooks::onAccountCreated';
|
||||||
$wgHooks['ArticleRollbackComplete'][] = 'EchoHooks::onRollbackComplete';
|
$wgHooks['ArticleRollbackComplete'][] = 'EchoHooks::onRollbackComplete';
|
||||||
|
$wgHooks['UserSaveSettings'][] = 'EchoHooks::onUserSaveSettings';
|
||||||
|
|
||||||
// Disable ordinary user talk page email notifications
|
// Disable ordinary user talk page email notifications
|
||||||
$wgHooks['AbortEmailNotification'][] = 'EchoHooks::disableStandUserTalkEnotif';
|
$wgHooks['AbortEmailNotification'][] = 'EchoHooks::disableStandUserTalkEnotif';
|
||||||
|
|
14
Hooks.php
14
Hooks.php
|
@ -697,4 +697,18 @@ class EchoHooks {
|
||||||
|
|
||||||
return true;
|
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