Index: trunk/phase3/includes/PatrolLog.php |
— | — | @@ -14,22 +14,26 @@ |
15 | 15 | * @param mixed $change Change identifier or RecentChange object |
16 | 16 | * @param bool $auto Was this patrol event automatic? |
17 | 17 | */ |
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 ) ) |
22 | 22 | return false; |
23 | 23 | } |
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' ) ); |
26 | 25 | if( is_object( $title ) ) { |
27 | | - $params = self::buildParams( $change, $auto ); |
| 26 | + $params = self::buildParams( $rc, $auto ); |
28 | 27 | $log = new LogPage( 'patrol', false ); # False suppresses RC entries |
29 | 28 | $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 | + } |
30 | 35 | return true; |
31 | | - } else { |
32 | | - return false; |
33 | 36 | } |
| 37 | + return false; |
34 | 38 | } |
35 | 39 | |
36 | 40 | /** |