From: Ævar Arnfjörð Bjarmason Date: Thu, 3 Nov 2005 11:27:10 +0000 (+0000) Subject: * (bug 3270) show put rc_id in the IRC RC url for wikis that have $wgUseRCPatrol... X-Git-Tag: 1.6.0~1229 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=b3c89f297559c3f11a5bc96086280a64a6701898;p=lhc%2Fweb%2Fwiklou.git * (bug 3270) show put rc_id in the IRC RC url for wikis that have $wgUseRCPatrol enabled --- diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 4df26d06a0..bc3d250fde 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -104,7 +104,7 @@ class RecentChange # Writes the data in this object to the database function save() { - global $wgLocalInterwiki, $wgPutIPinRC, $wgRC2UDPAddress, $wgRC2UDPPort, $wgRC2UDPPrefix; + global $wgLocalInterwiki, $wgPutIPinRC, $wgRC2UDPAddress, $wgRC2UDPPort, $wgRC2UDPPrefix, $wgUseRCPatrol; $fname = 'RecentChange::save'; $dbw =& wfGetDB( DB_MASTER ); @@ -125,6 +125,11 @@ class RecentChange # Insert new row $dbw->insert( 'recentchanges', $this->mAttribs, $fname ); + if ( $wgUseRCPatrol ) { + # Retrieve the id assigned by the db, but only if we'll use it later + $this->mAttribs['rc_id'] = $dbw->insertId(); + } + # Update old rows, if necessary if ( $this->mAttribs['rc_type'] == RC_EDIT ) { $oldid = $this->mAttribs['rc_last_oldid']; @@ -422,6 +427,8 @@ class RecentChange } function getIRCLine() { + global $wgUseRCPatrol; + extract($this->mAttribs); extract($this->mExtra); @@ -434,6 +441,8 @@ class RecentChange if ( $rc_new ) { $url = $titleObj->getFullURL(); + } else if ( $wgUseRCPatrol ) { + $url = $titleObj->getFullURL("diff=0&oldid=$rc_last_oldid&rcid=$rc_id"); } else { $url = $titleObj->getFullURL("diff=0&oldid=$rc_last_oldid"); }