}
# 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'] );
+ }
}
}