mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-28 01:30:15 +00:00
Merge "Don't send email notifs to blocked users if $wgBlockDisablesLogin is true"
This commit is contained in:
commit
b0d83815b9
|
@ -31,13 +31,18 @@ class EchoNotifier {
|
|||
* @return bool
|
||||
*/
|
||||
public static function notifyWithEmail( $user, $event ) {
|
||||
global $wgEnableEmail;
|
||||
global $wgEnableEmail, $wgBlockDisablesLogin;
|
||||
|
||||
if ( !$wgEnableEmail ) {
|
||||
return false;
|
||||
}
|
||||
// No valid email address or email notification
|
||||
if ( !$user->isEmailConfirmed() || $user->getOption( 'echo-email-frequency' ) < 0 ) {
|
||||
if (
|
||||
// Email is globally disabled
|
||||
!$wgEnableEmail ||
|
||||
// User does not have a valid and confirmed email address
|
||||
!$user->isEmailConfirmed() ||
|
||||
// User has disabled Echo emails
|
||||
$user->getOption( 'echo-email-frequency' ) < 0 ||
|
||||
// User is blocked and cannot log in (T199993)
|
||||
( $wgBlockDisablesLogin && $user->isBlocked() )
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue