wiki.techinc.nl/includes/EnotifNotifyJob.php
Brion Vibber 97f77b9b1a Revert r44702, r44703, r44704 (wfInvoke and UserMailer refactor based on it) and r44715, r44721 (cleanup thereof)
As Tim notes, the weird callback setup in $wgHooks isn't really something we want to replicate or ever rely on ever again, as PHP's native callback syntax already handles things fine and is more consistent (and used extensively in the rest of MediaWiki).
May be other remaining issues with the refactor on top of bugs already discovered, but if it's going to be refactored to use callbacks it should be done using regular callbacks.
2008-12-23 18:08:43 +00:00

34 lines
821 B
PHP

<?php
/**
* Job for email notification mails
*
* @ingroup JobQueue
*/
class EnotifNotifyJob extends Job {
function __construct( $title, $params, $id = 0 ) {
parent::__construct( 'enotifNotify', $title, $params, $id );
}
function run() {
$enotif = new EmailNotification();
// Get the user from ID (rename safe). Anons are 0, so defer to name.
if( isset($this->params['editorID']) && $this->params['editorID'] ) {
$editor = User::newFromId( $this->params['editorID'] );
// B/C, only the name might be given.
} else {
$editor = User::newFromName( $this->params['editor'], false );
}
$enotif->actuallyNotifyOnPageChange(
$editor,
$this->title,
$this->params['timestamp'],
$this->params['summary'],
$this->params['minorEdit'],
$this->params['oldid']
);
return true;
}
}