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