Merge "Improve "selfmove" message's wording"
[lhc/web/wiklou.git] / includes / rcfeed / IRCColourfulRCFeedFormatter.php
index c800c36..531a3eb 100644 (file)
 class IRCColourfulRCFeedFormatter implements RCFeedFormatter {
        /**
         * @see RCFeedFormatter::getLine
+        * @param array $feed
+        * @param RecentChange $rc
+        * @param string|null $actionComment
+        * @return string|null
         */
        public function getLine( array $feed, RecentChange $rc, $actionComment ) {
                global $wgUseRCPatrol, $wgUseNPPatrol, $wgLocalInterwikis,
                        $wgCanonicalServer, $wgScript;
                $attribs = $rc->getAttributes();
+               if ( $attribs['rc_type'] == RC_CATEGORIZE ) {
+                       // Don't send RC_CATEGORIZE events to IRC feed (T127360)
+                       return null;
+               }
+
                if ( $attribs['rc_type'] == RC_LOG ) {
                        // Don't use SpecialPage::getTitleFor, backwards compatibility with
                        // IRC API which expects "Log".
@@ -84,7 +93,9 @@ class IRCColourfulRCFeedFormatter implements RCFeedFormatter {
                        ) );
                        $flag = $attribs['rc_log_action'];
                } else {
-                       $comment = self::cleanupForIRC( $attribs['rc_comment'] );
+                       $comment = self::cleanupForIRC(
+                               CommentStore::newKey( 'rc_comment' )->getComment( $attribs )->text
+                       );
                        $flag = '';
                        if ( !$attribs['rc_patrolled']
                                && ( $wgUseRCPatrol || $attribs['rc_type'] == RC_NEW && $wgUseNPPatrol )