From 6470c757216521212362a019debd78c285f64dcb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Thu, 3 Nov 2011 17:07:29 +0000 Subject: [PATCH] Quick ugly fix to avoid duplicate log entries in rc feed. I didn't think that save() would send lines, since there was function to do that (added in r45725 - duplicating existing code). This part of codebase could use much TLC --- includes/RecentChange.php | 12 ++++++------ includes/logging/LogEntry.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/includes/RecentChange.php b/includes/RecentChange.php index c87b37e70b..fd5325ca13 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -158,10 +158,10 @@ class RecentChange { /** * Writes the data in this object to the database + * @param $noudp bool */ - public function save() { - global $wgLocalInterwiki, $wgPutIPinRC, $wgRC2UDPAddress, $wgRC2UDPOmitBots; - $fname = 'RecentChange::save'; + public function save( $noudp = false ) { + global $wgLocalInterwiki, $wgPutIPinRC; $dbw = wfGetDB( DB_MASTER ); if( !is_array($this->mExtra) ) { @@ -189,7 +189,7 @@ class RecentChange { } # Insert new row - $dbw->insert( 'recentchanges', $this->mAttribs, $fname ); + $dbw->insert( 'recentchanges', $this->mAttribs, __METHOD__ ); # Set the ID $this->mAttribs['rc_id'] = $dbw->insertId(); @@ -198,8 +198,8 @@ class RecentChange { wfRunHooks( 'RecentChange_save', array( &$this ) ); # Notify external application via UDP - if( $wgRC2UDPAddress && ( !$this->mAttribs['rc_bot'] || !$wgRC2UDPOmitBots ) ) { - self::sendToUDP( $this->getIRCLine() ); + if ( !$noudp ) { + $this->notifyRC2UDP() } # E-mail notifications diff --git a/includes/logging/LogEntry.php b/includes/logging/LogEntry.php index 0373d75f98..31ef99a156 100644 --- a/includes/logging/LogEntry.php +++ b/includes/logging/LogEntry.php @@ -417,7 +417,7 @@ class ManualLogEntry extends LogEntryBase { ); if ( $to === 'rc' || $to === 'rcandudp' ) { - $rc->save(); + $rc->save( 'pleasedontudp' ); } if ( $to === 'udp' || $to === 'rcandudp' ) { -- 2.20.1