Apply live hack from Wikimedia codebase: add a hook UserCanSendEmail to override...
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 29 Jan 2008 00:29:38 +0000 (00:29 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 29 Jan 2008 00:29:38 +0000 (00:29 +0000)
includes/User.php

index ba77fdd..08c7a51 100644 (file)
@@ -2459,7 +2459,9 @@ class User {
         * @return bool
         */
        function canSendEmail() {
-               return $this->isEmailConfirmed();
+               $canSend = $this->isEmailConfirmed();
+               wfRunHooks( 'UserCanSendEmail', array( &$this, &$canSend ) );
+               return $canSend;
        }
 
        /**
@@ -2468,7 +2470,7 @@ class User {
         * @return bool
         */
        function canReceiveEmail() {
-               return $this->canSendEmail() && !$this->getOption( 'disablemail' );
+               return $this->isEmailConfirmed() && !$this->getOption( 'disablemail' );
        }
 
        /**