]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - includes/EnotifNotifyJob.php
MediaWiki 1.15.5
[autoinstallsdev/mediawiki.git] / includes / EnotifNotifyJob.php
1 <?php
2
3 /**
4  * Job for email notification mails
5  *
6  * @ingroup JobQueue
7  */
8 class EnotifNotifyJob extends Job {
9
10         function __construct( $title, $params, $id = 0 ) {
11                 parent::__construct( 'enotifNotify', $title, $params, $id );
12         }
13
14         function run() {
15                 $enotif = new EmailNotification();
16                 // Get the user from ID (rename safe). Anons are 0, so defer to name.
17                 if( isset($this->params['editorID']) && $this->params['editorID'] ) {
18                         $editor = User::newFromId( $this->params['editorID'] );
19                 // B/C, only the name might be given.
20                 } else {
21                         $editor = User::newFromName( $this->params['editor'], false );
22                 }
23                 $enotif->actuallyNotifyOnPageChange(
24                         $editor,
25                         $this->title,
26                         $this->params['timestamp'],
27                         $this->params['summary'],
28                         $this->params['minorEdit'],
29                         $this->params['oldid'],
30                         $this->params['watchers']
31                 );
32                 return true;
33         }
34
35 }