48 $mainConfig = MediaWikiServices::getInstance()->getMainConfig();
49 $useRCPatrol = $mainConfig->get( MainConfigNames::UseRCPatrol );
50 $useNPPatrol = $mainConfig->get( MainConfigNames::UseNPPatrol );
51 $localInterwikis = $mainConfig->get( MainConfigNames::LocalInterwikis );
52 $canonicalServer = $mainConfig->get( MainConfigNames::CanonicalServer );
53 $script = $mainConfig->get( MainConfigNames::Script );
60 if ( $attribs[
'rc_type'] ==
RC_LOG ) {
63 $titleObj = Title::newFromText(
'Log/' . $attribs[
'rc_log_type'],
NS_SPECIAL );
67 $title = $titleObj->getPrefixedText();
70 if ( $attribs[
'rc_type'] ==
RC_LOG ) {
73 $url = $canonicalServer . $script;
74 if ( $attribs[
'rc_type'] ==
RC_NEW ) {
75 $query =
'?oldid=' . $attribs[
'rc_this_oldid'];
77 $query =
'?diff=' . $attribs[
'rc_this_oldid'] .
'&oldid=' . $attribs[
'rc_last_oldid'];
79 if ( $useRCPatrol || ( $attribs[
'rc_type'] ==
RC_NEW && $useNPPatrol ) ) {
80 $query .=
'&rcid=' . $attribs[
'rc_id'];
83 Hooks::runner()->onIRCLineURL( $url, $query, $rc );
87 if ( $attribs[
'rc_old_len'] !==
null && $attribs[
'rc_new_len'] !==
null ) {
88 $szdiff = $attribs[
'rc_new_len'] - $attribs[
'rc_old_len'];
89 if ( $szdiff < -500 ) {
90 $szdiff =
"\002$szdiff\002";
91 } elseif ( $szdiff >= 0 ) {
92 $szdiff =
'+' . $szdiff;
95 $szdiff =
'(' . $szdiff .
')';
102 if ( $attribs[
'rc_type'] ==
RC_LOG ) {
103 $targetText = $rc->
getTitle()->getPrefixedText();
106 "[[\00302$targetText\00310]]",
109 $flag = $attribs[
'rc_log_action'];
111 $store = MediaWikiServices::getInstance()->getCommentStore();
114 if ( !$attribs[
'rc_patrolled']
115 && ( $useRCPatrol || $attribs[
'rc_type'] ==
RC_NEW && $useNPPatrol )
119 $flag .= ( $attribs[
'rc_type'] ==
RC_NEW ?
"N" :
"" )
120 . ( $attribs[
'rc_minor'] ?
"M" :
"" ) . ( $attribs[
'rc_bot'] ?
"B" :
"" );
123 if ( $feed[
'add_interwiki_prefix'] ===
true && $localInterwikis ) {
125 $prefix = $localInterwikis[0];
126 } elseif ( $feed[
'add_interwiki_prefix'] ) {
127 $prefix = $feed[
'add_interwiki_prefix'];
131 if ( $prefix !==
false ) {
132 $titleString =
"\00314[[\00303$prefix:\00307$title\00314]]";
134 $titleString =
"\00314[[\00307$title\00314]]";
138 # no colour (\003) switches back to the term default
139 $fullString =
"$titleString\0034 $flag\00310 " .
140 "\00302$url\003 \0035*\003 \00303$user\003 \0035*\003 $szdiff \00310$comment\003\n";