EnotifNotifyJob.php 851 B

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