Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2394
rcHook.diff
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 8:52 PM
2014-11-21 20:52:58 (UTC+0)
Size
3 KB
Referenced Files
None
Subscribers
None
rcHook.diff
View Options
Index: RecentChange.php
===================================================================
RCS file: /cvsroot/wikipedia/phase3/includes/RecentChange.php,v
retrieving revision 1.37
diff -u -r1.37 RecentChange.php
--- RecentChange.php 20 Sep 2005 00:14:01 -0000 1.37
+++ RecentChange.php 11 Oct 2005 00:05:28 -0000
@@ -102,9 +102,10 @@
}
# Writes the data in this object to the database
+ # add triggers an 'RecentChange' event on the hook engine.
function save()
{
- global $wgLocalInterwiki, $wgPutIPinRC, $wgRC2UDPAddress, $wgRC2UDPPort, $wgRC2UDPPrefix;
+ global $wgLocalInterwiki, $wgPutIPinRC;
$fname = 'RecentChange::save';
$dbw =& wfGetDB( DB_MASTER );
@@ -157,15 +158,8 @@
# array( 'rc_cur_id' => $curId ), $fname );
}
- # Notify external application via UDP
- if ( $wgRC2UDPAddress ) {
- $conn = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP );
- if ( $conn ) {
- $line = $wgRC2UDPPrefix . $this->getIRCLine();
- socket_sendto( $conn, $line, strlen($line), 0, $wgRC2UDPAddress, $wgRC2UDPPort );
- socket_close( $conn );
- }
- }
+ # Send notifications via hooks
+ wfRunHooks( 'RecentChange', array( &$this ) );
}
# Marks a certain row as patrolled
@@ -421,44 +415,6 @@
return $trail;
}
- function getIRCLine() {
- extract($this->mAttribs);
- extract($this->mExtra);
-
- $titleObj =& $this->getTitle();
-
- $bad = array("\n", "\r");
- $empty = array("", "");
- $title = $titleObj->getPrefixedText();
- $title = str_replace($bad, $empty, $title);
-
- if ( $rc_new ) {
- $url = $titleObj->getFullURL();
- } else {
- $url = $titleObj->getFullURL("diff=0&oldid=$rc_last_oldid");
- }
-
- if ( isset( $oldSize ) && isset( $newSize ) ) {
- $szdiff = $newSize - $oldSize;
- if ($szdiff < -500)
- $szdiff = "\002$szdiff\002";
- else if ($szdiff >= 0)
- $szdiff = "+$szdiff";
- $szdiff = "($szdiff)";
- } else {
- $szdiff = '';
- }
-
- $comment = str_replace($bad, $empty, $rc_comment);
- $user = str_replace($bad, $empty, $rc_user_text);
- $flag = ($rc_minor ? "M" : "") . ($rc_new ? "N" : "");
- # see http://www.irssi.org/?page=docs&doc=formats for some colour codes. prefix is \003,
- # no colour (\003) switches back to the term default
- $comment = preg_replace("/\/\* (.*) \*\/(.*)/", "\00315\$1\003 - \00310\$2\003", $comment);
- $fullString = "\00314[[\00307$title\00314]]\0034 $flag\00310 " .
- "\00302$url\003 \0035*\003 \00303$user\003 \0035*\003 $szdiff \00310$comment\003\n";
-
- return $fullString;
- }
}
+
?>
Index: DefaultSettings.php
===================================================================
RCS file: /cvsroot/wikipedia/phase3/includes/DefaultSettings.php,v
retrieving revision 1.378
diff -u -r1.378 DefaultSettings.php
--- DefaultSettings.php 8 Oct 2005 16:02:24 -0000 1.378
+++ DefaultSettings.php 11 Oct 2005 00:05:31 -0000
@@ -1145,12 +1145,6 @@
*/
$wgRCMaxAge = 7 * 24 * 3600;
-
-# Send RC updates via UDP
-$wgRC2UDPAddress = false;
-$wgRC2UDPPort = false;
-$wgRC2UDPPrefix = '';
-
#
# Copyright and credits settings
#
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1970
Default Alt Text
rcHook.diff (3 KB)
Attached To
Mode
T5670: PATCH: extension hook for RC notification
Attached
Detach File
Event Timeline
Log In to Comment