Code style cleanups to notifyOnPageChange()
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 30 Jan 2016 00:03:29 +0000 (16:03 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 30 Jan 2016 00:03:29 +0000 (16:03 -0800)
Change-Id: I08593be2eba6417cdfae31b1aa1021da7db00c74

includes/mail/EmailNotification.php

index e51b434..8bac6b8 100644 (file)
@@ -166,22 +166,21 @@ class EmailNotification {
                        }
                }
 
-               if ( !$sendEmail ) {
-                       return;
+               if ( $sendEmail ) {
+                       JobQueueGroup::singleton()->lazyPush( new EnotifNotifyJob(
+                               $title,
+                               array(
+                                       'editor' => $editor->getName(),
+                                       'editorID' => $editor->getID(),
+                                       'timestamp' => $timestamp,
+                                       'summary' => $summary,
+                                       'minorEdit' => $minorEdit,
+                                       'oldid' => $oldid,
+                                       'watchers' => $watchers,
+                                       'pageStatus' => $pageStatus
+                               )
+                       ) );
                }
-
-               $params = array(
-                       'editor' => $editor->getName(),
-                       'editorID' => $editor->getID(),
-                       'timestamp' => $timestamp,
-                       'summary' => $summary,
-                       'minorEdit' => $minorEdit,
-                       'oldid' => $oldid,
-                       'watchers' => $watchers,
-                       'pageStatus' => $pageStatus
-               );
-               $job = new EnotifNotifyJob( $title, $params );
-               JobQueueGroup::singleton()->lazyPush( $job );
        }
 
        /**