MediaWiki master
MediaWiki\RecentChanges\RecentChangeNotifier Class Reference

Find watchers and create notifications after a page is changed. More...

Public Member Functions

 actuallyNotifyOnPageChange (Authority $editor, $title, RecentChange $recentChange, array $watchers, $pageStatus='changed')
 Immediate version of notifyOnPageChange().
 
 notifyOnPageChange (RecentChange $recentChange)
 Send emails corresponding to the user $editor editing the page $title.
 

Detailed Description

Find watchers and create notifications after a page is changed.

After an edit is published to RCFeed, RecentChange::save calls RecentChangeNotifier. Here we query the watchlist table (via WatchedItemStore) to find who is watching a given page, format the emails in question, and dispatch notifications to each of them via the JobQueue.

Visit the documentation pages under https://www.mediawiki.org/wiki/Help:Watching_pages

Todo
Use UserOptionsLookup and other services, consider converting this to a service
Since
1.11.0

Definition at line 41 of file RecentChangeNotifier.php.

Member Function Documentation

◆ actuallyNotifyOnPageChange()

MediaWiki\RecentChanges\RecentChangeNotifier::actuallyNotifyOnPageChange ( Authority $editor,
$title,
RecentChange $recentChange,
array $watchers,
$pageStatus = 'changed' )

Immediate version of notifyOnPageChange().

Send emails corresponding to the user $editor editing the page $title.

Note
Use notifyOnPageChange so that wl_notificationtimestamp is updated.
Parameters
Authority$editor
Title$title
RecentChange$recentChange
array$watchersArray of user IDs
string$pageStatus
Access: internal

Definition at line 145 of file RecentChangeNotifier.php.

References MediaWiki\RecentChanges\RecentChange\getAttribute(), MediaWiki\User\Options\UserOptionsLookup\getOption(), MediaWiki\Permissions\Authority\getUser(), MediaWiki\Permissions\Authority\isAllowed(), and NS_USER_TALK.

◆ notifyOnPageChange()

MediaWiki\RecentChanges\RecentChangeNotifier::notifyOnPageChange ( RecentChange $recentChange)

Send emails corresponding to the user $editor editing the page $title.

May be deferred via the job queue.

Parameters
RecentChange$recentChange
Returns
bool Whether an email & notification job was created or not.
Access: internal

Definition at line 52 of file RecentChangeNotifier.php.


The documentation for this class was generated from the following file: