From a3e1c7fa4fc395e66bb7df9e287504acc7065c1f Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 29 Jan 2008 00:29:38 +0000 Subject: [PATCH] Apply live hack from Wikimedia codebase: add a hook UserCanSendEmail to override User::canSendEmail(); make canReceiveEmail() indenpedent of sending permission check. --- includes/User.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/User.php b/includes/User.php index ba77fddaf7..08c7a51ac4 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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' ); } /** -- 2.20.1