* Move up the UPDATE query on wl_notificationtimestamp up to before scheduling the EnotifyNotifyJob * Move up the SELECT query fetching the users to be notified to before the UPDATE, and use its result for a more efficient UPDATE * Pass actuallyNotifyOnPageChange() and the EnotifyNotifyJob an array of user IDs * Add UserArray::newFromIDs()
35 lines
851 B
PHP
35 lines
851 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'],
|
|
$this->params['watchers']
|
|
);
|
|
return true;
|
|
}
|
|
|
|
}
|