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;
}
}
# E-mail notifications
- global $wgUseEnotif, $wgUser;
- if( $wgUseEnotif ) {
+ global $wgUseEnotif, $wgShowUpdatedMarker, $wgUser;
+ if( $wgUseEnotif || $wgShowUpdatedMarker ) {
// Users
if( $this->mAttribs['rc_user'] ) {
$editor = ($wgUser->getID() == $this->mAttribs['rc_user']) ?
if ($wgEnotifUseJobQ) {
$params = array(
"editor" => $editor->getName(),
+ "editorID" => $editor->getID(),
"timestamp" => $timestamp,
"summary" => $summary,
"minorEdit" => $minorEdit,
}
}
-
if ( $wgEnotifWatchlist ) {
// Send updates to watchers other than the current editor
- $userCondition = 'wl_user <> ' . intval( $editor->getId() );
+ $userCondition = 'wl_user != ' . $editor->getID();
if ( $userTalkId !== false ) {
// Already sent an email to this person
- $userCondition .= ' AND wl_user <> ' . intval( $userTalkId );
+ $userCondition .= ' AND wl_user != ' . intval( $userTalkId );
}
$dbr = wfGetDB( DB_SLAVE );
$this->sendMails();
if ( $wgShowUpdatedMarker || $wgEnotifWatchlist ) {
- # mark the changed watch-listed page with a timestamp, so that the page is
- # listed with an "updated since your last visit" icon in the watch list, ...
+ # Mark the changed watch-listed page with a timestamp, so that the page is
+ # listed with an "updated since your last visit" icon in the watch list. Do
+ # not do this to users for their own edits.
$dbw = wfGetDB( DB_MASTER );
$dbw->update( 'watchlist',
array( /* SET */
), array( /* WHERE */
'wl_title' => $title->getDBkey(),
'wl_namespace' => $title->getNamespace(),
- 'wl_notificationtimestamp IS NULL'
+ 'wl_notificationtimestamp IS NULL',
+ 'wl_user != ' . $editor->getID()
), __METHOD__
);
}