Changed RecentChange::notifyRCFeeds() to allow more
filter options than just omit_bots. In order to mirror
the on-wiki Special:RecentChanges UI, the options
omit_anon, omit_user, omit_minor, omit_patrolled were added,
which omits anonymous, registered, minor, and patrolled
edits, respectively.
Bug: 60941
Change-Id: I716c741f1f7d42b6506a97e9a5733beac23ac16c
* * 'formatter' -- the class name (implementing RCFeedFormatter) which will
* produce the text to send.
* * 'omit_bots' -- whether the bot edits should be in the feed
+ * * 'omit_anon' -- whether anonymous edits should be in the feed
+ * * 'omit_user' -- whether edits by registered users should be in the feed
+ * * 'omit_minor' -- whether minor edits should be in the feed
+ * * 'omit_patrolled' -- whether patrolled edits should be in the feed
* The IRC-specific options are:
* * 'add_interwiki_prefix' -- whether the titles should be prefixed with
* the first entry in the $wgLocalInterwikis array (or the value of
public function notifyRCFeeds() {
global $wgRCFeeds;
+ $performer = $this->getPerformer();
+
foreach ( $wgRCFeeds as $feed ) {
- $omitBots = isset( $feed['omit_bots'] ) ? $feed['omit_bots'] : false;
+ $feed += array(
+ 'omit_bots' => false,
+ 'omit_anon' => false,
+ 'omit_user' => false,
+ 'omit_minor' => false,
+ 'omit_patrolled' => false,
+ );
if (
- ( $omitBots && $this->mAttribs['rc_bot'] ) ||
+ ( $feed['omit_bots'] && $this->mAttribs['rc_bot'] ) ||
+ ( $feed['omit_anon'] && $performer->isAnon() ) ||
+ ( $feed['omit_user'] && !$performer->isAnon() ) ||
+ ( $feed['omit_minor'] && $this->mAttribs['rc_minor'] ) ||
+ ( $feed['omit_patrolled'] && $this->mAttribs['rc_patrolled'] ) ||
$this->mAttribs['rc_type'] == RC_EXTERNAL
) {
continue;