]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - includes/EnotifNotifyJob.php
MediaWiki 1.14.0
[autoinstallsdev/mediawiki.git] / includes / EnotifNotifyJob.php
index 70d1de694b5ea80aa6fe040e1909ed7cfffe5e05..31fcb0d5c677f880959a08db0e916051553aacc9 100644 (file)
@@ -2,6 +2,8 @@
 
 /**
  * Job for email notification mails
+ *
+ * @ingroup JobQueue
  */
 class EnotifNotifyJob extends Job {
 
@@ -11,16 +13,22 @@ class EnotifNotifyJob extends Job {
 
        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(
-                       User::newFromName( $this->params['editor'], false ),
-                               $this->title,
-                               $this->params['timestamp'],
-                               $this->params['summary'],
-                               $this->params['minorEdit'],
-                               $this->params['oldid']
+                       $editor,
+                       $this->title,
+                       $this->params['timestamp'],
+                       $this->params['summary'],
+                       $this->params['minorEdit'],
+                       $this->params['oldid']
                );
                return true;
        }
-       
-}
 
+}