From bf27a2741f02064ef762a03084f83a9337825b3e Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 13 Nov 2008 08:51:10 +0000 Subject: [PATCH] Improved $wgRC2UDPInterwikiPrefix feature, so that it can actually be a prefix and not just a boolean. Documented RC2UDP settings. --- includes/DefaultSettings.php | 26 +++++++++++++++++++++++++- includes/RecentChange.php | 13 ++++++++++--- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index fdd91a6d37..3bafd96bc8 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2104,11 +2104,35 @@ $wgRCFilterByAge = false; $wgRCLinkLimits = array( 50, 100, 250, 500 ); $wgRCLinkDays = array( 1, 3, 7, 14, 30 ); -# Send RC updates via UDP +/** + * Send recent changes updates via UDP. The updates will be formatted for IRC. + * Set this to the IP address of the receiver. + */ $wgRC2UDPAddress = false; + +/** + * Port number for RC updates + */ $wgRC2UDPPort = false; + +/** + * Prefix to prepend to each UDP packet. + * This can be used to identify the wiki. A script is available called + * mxircecho.py which listens on a UDP port, and uses a prefix ending in a + * tab to identify the IRC channel to send the log line to. + */ $wgRC2UDPPrefix = ''; + +/** + * If this is set to true, $wgLocalInterwiki will be prepended to links in the + * IRC feed. If this is set to a string, that string will be used as the prefix. + */ $wgRC2UDPInterwikiPrefix = false; + +/** + * Set to true to omit "bot" edits (by users with the bot permission) from the + * UDP feed. + */ $wgRC2UDPOmitBots = false; /** diff --git a/includes/RecentChange.php b/includes/RecentChange.php index afb122d58d..d0714668da 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -641,9 +641,16 @@ class RecentChange $comment = self::cleanupForIRC( $rc_comment ); $flag = ($rc_new ? "N" : "") . ($rc_minor ? "M" : "") . ($rc_bot ? "B" : ""); } - - if( $wgRC2UDPInterwikiPrefix && isset( $wgLocalInterwiki ) ) { - $titleString = "\00314[[\00303$wgLocalInterwiki:\00307$title\00314]]"; + + if ( $wgRC2UDPInterwikiPrefix === true ) { + $prefix = $wgLocalInterwiki; + } elseif ( $wgRC2UDPInterwikiPrefix ) { + $prefix = $wgRC2UDPInterwikiPrefix; + } else { + $prefix = false; + } + if ( $prefix !== false ) { + $titleString = "\00314[[\00303$prefix:\00307$title\00314]]"; } else { $titleString = "\00314[[\00307$title\00314]]"; } -- 2.20.1