From: Siebrand Date: Sun, 29 Jul 2012 20:43:36 +0000 (+0000) Subject: Merge "Store the Title and User objects passed RecentChange::notify*()" X-Git-Tag: 1.31.0-rc.0~22923 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=f021d3a8eb43aac1ebb391b28c1bf6c4e5f40f6f;p=lhc%2Fweb%2Fwiklou.git Merge "Store the Title and User objects passed RecentChange::notify*()" --- f021d3a8eb43aac1ebb391b28c1bf6c4e5f40f6f diff --cc includes/RecentChange.php index 20e7909a2a,62c539bc1e..4a7bafd900 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@@ -218,28 -239,17 +239,19 @@@ class RecentChange } # E-mail notifications - global $wgUseEnotif, $wgShowUpdatedMarker, $wgUser; if( $wgUseEnotif || $wgShowUpdatedMarker ) { - // Users - if( $this->mAttribs['rc_user'] ) { - $editor = ($wgUser->getId() == $this->mAttribs['rc_user']) ? - $wgUser : User::newFromID( $this->mAttribs['rc_user'] ); - // Anons - } else { - $editor = ($wgUser->getName() == $this->mAttribs['rc_user_text']) ? - $wgUser : User::newFromName( $this->mAttribs['rc_user_text'], false ); - } - $title = Title::makeTitle( $this->mAttribs['rc_namespace'], $this->mAttribs['rc_title'] ); + $editor = $this->getPerformer(); + $title = $this->getTitle(); - # @todo FIXME: This would be better as an extension hook - $enotif = new EmailNotification(); - $status = $enotif->notifyOnPageChange( $editor, $title, - $this->mAttribs['rc_timestamp'], - $this->mAttribs['rc_comment'], - $this->mAttribs['rc_minor'], - $this->mAttribs['rc_last_oldid'] ); + if ( wfRunHooks( 'AbortEmailNotification', array($editor, $title) ) ) { + # @todo FIXME: This would be better as an extension hook + $enotif = new EmailNotification(); + $status = $enotif->notifyOnPageChange( $editor, $title, + $this->mAttribs['rc_timestamp'], + $this->mAttribs['rc_comment'], + $this->mAttribs['rc_minor'], + $this->mAttribs['rc_last_oldid'] ); + } } }