mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-11 17:00:10 +00:00
Unset user-to-user email option when user emails are disabled
When one of the $wgEnableEmail and $wgEnableUserEmail variables is false, "Email from other user" option should not be shown in preferences. Bug: T266087 Change-Id: I38e439b778d2679967776757d8e0d3b63519612e
This commit is contained in:
parent
49530fddca
commit
2d8085bd15
|
@ -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