diff --git a/includes/EchoHooks.php b/includes/EchoHooks.php index edf365630..988950b32 100644 --- a/includes/EchoHooks.php +++ b/includes/EchoHooks.php @@ -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;