r45605 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45604‎ | r45605 | r45606 >
Date:17:57, 9 January 2009
Author:aaron
Status:reverted (Comments)
Tags:
Comment:
Send manual patrols to IRC (bug 16604)
Modified paths:
  • /trunk/phase3/includes/PatrolLog.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/PatrolLog.php
@@ -14,22 +14,26 @@
1515 * @param mixed $change Change identifier or RecentChange object
1616 * @param bool $auto Was this patrol event automatic?
1717 */
18 - public static function record( $change, $auto = false ) {
19 - if( !( is_object( $change ) && $change instanceof RecentChange ) ) {
20 - $change = RecentChange::newFromId( $change );
21 - if( !is_object( $change ) )
 18+ public static function record( $rc, $auto = false ) {
 19+ if( !( $rc instanceof RecentChange ) ) {
 20+ $rc = RecentChange::newFromId( $rc );
 21+ if( !is_object( $rc ) )
2222 return false;
2323 }
24 - $title = Title::makeTitleSafe( $change->getAttribute( 'rc_namespace' ),
25 - $change->getAttribute( 'rc_title' ) );
 24+ $title = Title::makeTitleSafe( $rc->getAttribute( 'rc_namespace' ), $rc->getAttribute( 'rc_title' ) );
2625 if( is_object( $title ) ) {
27 - $params = self::buildParams( $change, $auto );
 26+ $params = self::buildParams( $rc, $auto );
2827 $log = new LogPage( 'patrol', false ); # False suppresses RC entries
2928 $log->addEntry( 'patrol', $title, '', $params );
 29+ # Notify external application via UDP.
 30+ # We send this to IRC but do not want to add it the RC table.
 31+ global $wgRC2UDPAddress, $wgRC2UDPOmitBots;
 32+ if( $wgRC2UDPAddress && ( !$rc->getAttribute('rc_bot') || !$wgRC2UDPOmitBots ) ) {
 33+ self::sendToUDP( $rc->getIRCLine() );
 34+ }
3035 return true;
31 - } else {
32 - return false;
3336 }
 37+ return false;
3438 }
3539
3640 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r45610Revert r45605 and generalize the ability to have logs go to UDP.aaron18:30, 9 January 2009
r45974Show title/rev in IRC (bug 16604)aaron20:47, 21 January 2009
r46389* (bug 16604) Mark non-patrolled edits in feeds with "!"aaron21:19, 27 January 2009
r46393* (bug 16604) Show title/rev in IRC for patrol logaaron21:59, 27 January 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r45604Mark non-patrolled edits in feeds (bug 16604)aaron17:47, 9 January 2009

Comments

#Comment by Aaron Schulz (talk | contribs)   17:59, 9 January 2009

Typo fixed in r45606

#Comment by Aaron Schulz (talk | contribs)   18:31, 9 January 2009

Reverted (except for variable name/whitespace) in r45610.

This was also using the wrong RC object...

Status & tagging log