2007-06-21 19:11:24 +00:00
|
|
|
<?php
|
2010-09-03 18:24:42 +00:00
|
|
|
/**
|
|
|
|
|
* Job for notification emails.
|
|
|
|
|
*
|
|
|
|
|
* @file
|
|
|
|
|
* @ingroup JobQueue
|
|
|
|
|
*/
|
2007-06-21 19:11:24 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Job for email notification mails
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
*
|
|
|
|
|
* @ingroup JobQueue
|
2007-06-21 19:11:24 +00:00
|
|
|
*/
|
|
|
|
|
class EnotifNotifyJob extends Job {
|
|
|
|
|
|
|
|
|
|
function __construct( $title, $params, $id = 0 ) {
|
|
|
|
|
parent::__construct( 'enotifNotify', $title, $params, $id );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function run() {
|
2008-12-23 18:08:43 +00:00
|
|
|
$enotif = new EmailNotification();
|
2008-05-17 23:34:28 +00:00
|
|
|
// Get the user from ID (rename safe). Anons are 0, so defer to name.
|
2011-09-22 12:14:21 +00:00
|
|
|
if( isset( $this->params['editorID'] ) && $this->params['editorID'] ) {
|
2008-05-17 23:34:28 +00:00
|
|
|
$editor = User::newFromId( $this->params['editorID'] );
|
|
|
|
|
// B/C, only the name might be given.
|
|
|
|
|
} else {
|
2011-11-20 10:55:58 +00:00
|
|
|
# FIXME: newFromName could return false on a badly configured wiki.
|
2008-05-17 23:34:28 +00:00
|
|
|
$editor = User::newFromName( $this->params['editor'], false );
|
|
|
|
|
}
|
2008-12-23 18:08:43 +00:00
|
|
|
$enotif->actuallyNotifyOnPageChange(
|
2008-05-17 23:34:28 +00:00
|
|
|
$editor,
|
|
|
|
|
$this->title,
|
|
|
|
|
$this->params['timestamp'],
|
|
|
|
|
$this->params['summary'],
|
|
|
|
|
$this->params['minorEdit'],
|
2009-03-02 12:15:28 +00:00
|
|
|
$this->params['oldid'],
|
2009-09-11 01:04:00 +00:00
|
|
|
$this->params['watchers']
|
2007-06-21 19:11:24 +00:00
|
|
|
);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-14 07:45:50 +00:00
|
|
|
}
|