mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 17:20:40 +00:00
Merge "Unset user-to-user email option when user emails are disabled"
This commit is contained in:
commit
a2933f5c8b
|
@ -85,7 +85,8 @@ class EchoHooks implements RecentChange_saveHook {
|
|||
public static function initEchoExtension() {
|
||||
global $wgEchoNotifications, $wgEchoNotificationCategories, $wgEchoNotificationIcons,
|
||||
$wgEchoMentionStatusNotifications, $wgAllowArticleReminderNotification, $wgAPIModules,
|
||||
$wgEchoWatchlistNotifications, $wgEchoSeenTimeCacheType, $wgMainStash;
|
||||
$wgEchoWatchlistNotifications, $wgEchoSeenTimeCacheType, $wgMainStash, $wgEnableEmail,
|
||||
$wgEnableUserEmail;
|
||||
|
||||
// allow extensions to define their own event
|
||||
Hooks::run( 'BeforeCreateEchoEvent',
|
||||
|
@ -109,6 +110,11 @@ class EchoHooks implements RecentChange_saveHook {
|
|||
unset( $wgEchoNotificationCategories['minor-watchlist'] );
|
||||
}
|
||||
|
||||
// Only allow user email notifications when enabled
|
||||
if ( !$wgEnableEmail || !$wgEnableUserEmail ) {
|
||||
unset( $wgEchoNotificationCategories['emailuser'] );
|
||||
}
|
||||
|
||||
// Default $wgEchoSeenTimeCacheType to $wgMainStash
|
||||
if ( $wgEchoSeenTimeCacheType === null ) {
|
||||
$wgEchoSeenTimeCacheType = $wgMainStash;
|
||||
|
|
Loading…
Reference in a new issue