Drop the check for existences of LocalSettings.php in MediaWikiIntegrationTestCase
[lhc/web/wiklou.git] / includes / mail / EmailNotification.php
index acf2c2e..7361032 100644 (file)
@@ -224,7 +224,9 @@ class EmailNotification {
                                                && $watchingUser->isEmailConfirmed()
                                                && $watchingUser->getId() != $userTalkId
                                                && !in_array( $watchingUser->getName(), $wgUsersNotifiedOnAllChanges )
-                                               && !( $wgBlockDisablesLogin && $watchingUser->isBlocked() )
+                                               // @TODO Partial blocks should not prevent the user from logging in.
+                                               //       see: https://phabricator.wikimedia.org/T208895
+                                               && !( $wgBlockDisablesLogin && $watchingUser->getBlock() )
                                                && Hooks::run( 'SendWatchlistEmailNotification', [ $watchingUser, $title, $this ] )
                                        ) {
                                                $this->compose( $watchingUser, self::WATCHLIST );
@@ -262,7 +264,9 @@ class EmailNotification {
                                wfDebug( __METHOD__ . ": user talk page edited, but user does not exist\n" );
                        } elseif ( $targetUser->getId() == $editor->getId() ) {
                                wfDebug( __METHOD__ . ": user edited their own talk page, no notification sent\n" );
-                       } elseif ( $wgBlockDisablesLogin && $targetUser->isBlocked() ) {
+                       } elseif ( $wgBlockDisablesLogin && $targetUser->getBlock() ) {
+                               // @TODO Partial blocks should not prevent the user from logging in.
+                               //       see: https://phabricator.wikimedia.org/T208895
                                wfDebug( __METHOD__ . ": talk page owner is blocked and cannot login, no notification sent\n" );
                        } elseif ( $targetUser->getOption( 'enotifusertalkpages' )
                                && ( !$minorEdit || $targetUser->getOption( 'enotifminoredits' ) )
@@ -403,7 +407,7 @@ class EmailNotification {
         * @param User $user
         * @param string $source
         */
-       function compose( $user, $source ) {
+       private function compose( $user, $source ) {
                global $wgEnotifImpersonal;
 
                if ( !$this->composed_common ) {
@@ -420,7 +424,7 @@ class EmailNotification {
        /**
         * Send any queued mails
         */
-       function sendMails() {
+       private function sendMails() {
                global $wgEnotifImpersonal;
                if ( $wgEnotifImpersonal ) {
                        $this->sendImpersonal( $this->mailTargets );
@@ -436,9 +440,8 @@ class EmailNotification {
         * @param User $watchingUser
         * @param string $source
         * @return Status
-        * @private
         */
-       function sendPersonalised( $watchingUser, $source ) {
+       private function sendPersonalised( $watchingUser, $source ) {
                global $wgEnotifUseRealName;
                // From the PHP manual:
                //   Note: The to parameter cannot be an address in the form of
@@ -477,7 +480,7 @@ class EmailNotification {
         * @param MailAddress[] $addresses
         * @return Status|null
         */
-       function sendImpersonal( $addresses ) {
+       private function sendImpersonal( $addresses ) {
                if ( empty( $addresses ) ) {
                        return null;
                }