Index: branches/wmf/1.19wmf1/languages/messages/MessagesEn.php |
— | — | @@ -4708,6 +4708,32 @@ |
4709 | 4709 | 'logentry-newusers-autocreate' => 'Account $1 was created automatically', |
4710 | 4710 | 'newuserlog-byemail' => 'password sent by e-mail', |
4711 | 4711 | |
| 4712 | +# For IRC, see bug 34508. Do not change |
| 4713 | +'revdelete-logentry' => 'changed revision visibility of "[[$1]]"', |
| 4714 | +'logdelete-logentry' => 'changed event visibility of "[[$1]]"', |
| 4715 | +'revdelete-content' => 'content', |
| 4716 | +'revdelete-summary' => 'edit summary', |
| 4717 | +'revdelete-uname' => 'username', |
| 4718 | +'revdelete-hid' => 'hid $1', |
| 4719 | +'revdelete-unhid' => 'unhid $1', |
| 4720 | +'revdelete-log-message' => '$1 for $2 {{PLURAL:$2|revision|revisions}}', |
| 4721 | +'logdelete-log-message' => '$1 for $2 {{PLURAL:$2|event|events}}', |
| 4722 | +'deletedarticle' => 'deleted "[[$1]]"', |
| 4723 | +'suppressedarticle' => 'suppressed "[[$1]]"', |
| 4724 | +'undeletedarticle' => 'restored "[[$1]]"', |
| 4725 | +'patrol-log-line' => 'marked $1 of $2 patrolled $3', |
| 4726 | +'patrol-log-auto' => '(automatic)', |
| 4727 | +'patrol-log-diff' => 'revision $1', |
| 4728 | +'1movedto2' => 'moved [[$1]] to [[$2]]', |
| 4729 | +'1movedto2_redir' => 'moved [[$1]] to [[$2]] over redirect', |
| 4730 | +'move-redirect-suppressed' => 'redirect suppressed', |
| 4731 | +'newuserlog-byemail' => 'password sent by e-mail', |
| 4732 | +'newuserlog-create-entry' => 'New user account', |
| 4733 | +'newuserlog-create2-entry' => 'created new account $1', |
| 4734 | +'newuserlog-autocreate-entry' => 'Account created automatically', |
| 4735 | +'suppressedarticle' => 'suppressed "[[$1]]"', |
| 4736 | +'deletedarticle' => 'deleted "[[$1]]"', |
| 4737 | + |
4712 | 4738 | # Feedback |
4713 | 4739 | 'feedback-bugornote' => 'If you are ready to describe a technical problem in detail please [$1 report a bug]. |
4714 | 4740 | Otherwise, you can use the easy form below. Your comment will be added to the page "[$3 $2]", along with your username and what browser you are using.', |
Property changes on: branches/wmf/1.19wmf1/languages |
___________________________________________________________________ |
Modified: svn:mergeinfo |
4715 | 4741 | Merged /trunk/phase3/languages:r112049,112061-112063,112065-112066,112070-112071 |
Index: branches/wmf/1.19wmf1/includes/RecentChange.php |
— | — | @@ -503,10 +503,11 @@ |
504 | 504 | * @param $logComment |
505 | 505 | * @param $params |
506 | 506 | * @param $newId int |
| 507 | + * @param $actionCommentIRC string |
507 | 508 | * @return bool |
508 | 509 | */ |
509 | | - public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip='', $type, |
510 | | - $action, $target, $logComment, $params, $newId=0 ) |
| 510 | + public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip, $type, |
| 511 | + $action, $target, $logComment, $params, $newId=0, $actionCommentIRC='' ) |
511 | 512 | { |
512 | 513 | global $wgLogRestrictions; |
513 | 514 | # Don't add private logs to RC! |
— | — | @@ -514,7 +515,7 @@ |
515 | 516 | return false; |
516 | 517 | } |
517 | 518 | $rc = self::newLogEntry( $timestamp, $title, $user, $actionComment, $ip, $type, $action, |
518 | | - $target, $logComment, $params, $newId ); |
| 519 | + $target, $logComment, $params, $newId, $actionCommentIRC ); |
519 | 520 | $rc->save(); |
520 | 521 | return true; |
521 | 522 | } |
— | — | @@ -531,10 +532,11 @@ |
532 | 533 | * @param $logComment |
533 | 534 | * @param $params |
534 | 535 | * @param $newId int |
| 536 | + * @param $actionCommentIRC string |
535 | 537 | * @return RecentChange |
536 | 538 | */ |
537 | | - public static function newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip='', |
538 | | - $type, $action, $target, $logComment, $params, $newId=0 ) { |
| 539 | + public static function newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip, |
| 540 | + $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC='' ) { |
539 | 541 | global $wgRequest; |
540 | 542 | if( !$ip ) { |
541 | 543 | $ip = $wgRequest->getIP(); |
— | — | @@ -575,6 +577,7 @@ |
576 | 578 | 'prefixedDBkey' => $title->getPrefixedDBkey(), |
577 | 579 | 'lastTimestamp' => 0, |
578 | 580 | 'actionComment' => $actionComment, // the comment appended to the action, passed from LogPage |
| 581 | + 'actionCommentIRC' => $actionCommentIRC |
579 | 582 | ); |
580 | 583 | return $rc; |
581 | 584 | } |
— | — | @@ -712,7 +715,7 @@ |
713 | 716 | |
714 | 717 | if ( $this->mAttribs['rc_type'] == RC_LOG ) { |
715 | 718 | $targetText = $this->getTitle()->getPrefixedText(); |
716 | | - $comment = self::cleanupForIRC( str_replace( "[[$targetText]]", "[[\00302$targetText\00310]]", $this->mExtra['actionComment'] ) ); |
| 719 | + $comment = self::cleanupForIRC( str_replace( "[[$targetText]]", "[[\00302$targetText\00310]]", $this->mExtra['actionCommentIRC'] ) ); |
717 | 720 | $flag = $this->mAttribs['rc_log_action']; |
718 | 721 | } else { |
719 | 722 | $comment = self::cleanupForIRC( $this->mAttribs['rc_comment'] ); |
Index: branches/wmf/1.19wmf1/includes/logging/LogEntry.php |
— | — | @@ -461,14 +461,15 @@ |
462 | 462 | $this->getTimestamp(), |
463 | 463 | $logpage, |
464 | 464 | $user, |
465 | | - $formatter->getPlainActionText(), // Used for IRC feeds |
| 465 | + $formatter->getPlainActionText(), |
466 | 466 | $user->isAnon() ? $user->getName() : '', |
467 | 467 | $this->getType(), |
468 | 468 | $this->getSubtype(), |
469 | 469 | $this->getTarget(), |
470 | 470 | $this->getComment(), |
471 | 471 | serialize( (array) $this->getParameters() ), |
472 | | - $newId |
| 472 | + $newId, |
| 473 | + $formatter->getIRCActionComment() // Used for IRC feeds |
473 | 474 | ); |
474 | 475 | |
475 | 476 | if ( $to === 'rc' || $to === 'rcandudp' ) { |
Index: branches/wmf/1.19wmf1/includes/logging/LogFormatter.php |
— | — | @@ -77,6 +77,8 @@ |
78 | 78 | */ |
79 | 79 | protected $plaintext = false; |
80 | 80 | |
| 81 | + protected $irctext = false; |
| 82 | + |
81 | 83 | protected function __construct( LogEntry $entry ) { |
82 | 84 | $this->entry = $entry; |
83 | 85 | $this->context = RequestContext::getMain(); |
— | — | @@ -141,6 +143,132 @@ |
142 | 144 | } |
143 | 145 | |
144 | 146 | /** |
| 147 | + * Even uglier hack to maintain backwards compatibilty with IRC bots |
| 148 | + * (bug 34508). |
| 149 | + * @see getActionText() |
| 150 | + * @return string text |
| 151 | + */ |
| 152 | + public function getIRCActionComment() { |
| 153 | + $actionComment = $this->getIRCActionText(); |
| 154 | + $comment = $this->entry->getComment(); |
| 155 | + |
| 156 | + if ( $comment != '' ) { |
| 157 | + if ( $actionComment == '' ) { |
| 158 | + $actionComment = $comment; |
| 159 | + } else { |
| 160 | + $actionComment .= wfMsgForContent( 'colon-separator' ) . $comment; |
| 161 | + } |
| 162 | + } |
| 163 | + |
| 164 | + return $actionComment; |
| 165 | + } |
| 166 | + |
| 167 | + /** |
| 168 | + * Even uglier hack to maintain backwards compatibilty with IRC bots |
| 169 | + * (bug 34508). |
| 170 | + * @see getActionText() |
| 171 | + * @return string text |
| 172 | + */ |
| 173 | + public function getIRCActionText() { |
| 174 | + $this->plaintext = true; |
| 175 | + $text = $this->getActionText(); |
| 176 | + |
| 177 | + // wfRunHooks( 'LogEntry::publish', array( $this, $formatter, &$actionText ) ); |
| 178 | + // function efLegacyLogsIrcFormat( $entry, $formatter, &$text ) { |
| 179 | + |
| 180 | + $entry = $this->entry; |
| 181 | + $parameters = $entry->getParameters(); |
| 182 | + // Text of title the action is aimed at. |
| 183 | + $target = $entry->getTarget()->getText() ; |
| 184 | + $text = null; |
| 185 | + switch( $entry->getType() ) { |
| 186 | + case 'move': |
| 187 | + switch( $entry->getSubtype() ) { |
| 188 | + case 'move': |
| 189 | + $movesource = $parameters['4::target']; |
| 190 | + $text = wfMsg( '1movedto2', $target, $movesource ); |
| 191 | + break; |
| 192 | + case 'move_redir': |
| 193 | + $movesource = $parameters['4::target']; |
| 194 | + $text = wfMsg( '1movedto2_redir', $target, $movesource ); |
| 195 | + break; |
| 196 | + case 'move-noredirect': |
| 197 | + break; |
| 198 | + case 'move_redir-noredirect': |
| 199 | + break; |
| 200 | + } |
| 201 | + break; |
| 202 | + |
| 203 | + case 'delete': |
| 204 | + switch( $entry->getSubtype() ) { |
| 205 | + case 'delete': |
| 206 | + $text = wfMsg( 'deletedarticle', $target ); |
| 207 | + break; |
| 208 | + case 'restore': |
| 209 | + $text = wfMsg( 'undeletedarticle', $target ); |
| 210 | + break; |
| 211 | + //case 'revision': // Revision deletion |
| 212 | + //case 'event': // Log deletion |
| 213 | + // see https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/LogPage.php?&pathrev=97044&r1=97043&r2=97044 |
| 214 | + //default: |
| 215 | + } |
| 216 | + break; |
| 217 | + |
| 218 | + case 'patrol': |
| 219 | + // https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/PatrolLog.php?&pathrev=97495&r1=97494&r2=97495 |
| 220 | + // Create a diff link to the patrolled revision |
| 221 | + $diffLink = Linker::link( |
| 222 | + $target, |
| 223 | + htmlspecialchars( wfMsg( 'patrol-log-diff', $parameters['4::curid']) ), |
| 224 | + array(), |
| 225 | + /*query parameters */ array( 'oldid'=>$parameters['4::curid'], 'diff' => 'prev' ), |
| 226 | + array( 'known', 'noclasses' ) |
| 227 | + ); |
| 228 | + $link = Linker::link( $entry->getTarget() ); |
| 229 | + |
| 230 | + if ( $entry->getSubtype() === 'patrol' ) { |
| 231 | + // 'patrol-log-line' => 'marked $1 of $2 patrolled $3', |
| 232 | + // 'logentry-irc-patrol-patrol' => '$1 marked revision $4 of page $3 patrolled', |
| 233 | + |
| 234 | + $text = wfMsg( 'patrol-log-line', $diffLink, $link ); |
| 235 | + } elseif ( $entry->getSubtype() === 'patrol-auto' ) { |
| 236 | + // 'patrol-log-line' => 'marked $1 of $2 patrolled $3', |
| 237 | + // 'patrol-log-auto' => '(automatic)', |
| 238 | + // 'logentry-irc-patrol-patrol-auto' => '$1 automatically marked revision $4 of page $3 patrolled', |
| 239 | + // How is this done with old messages? Some abomination to man? |
| 240 | + $text = wfMsg( 'patrol-log-line-auto', $diffLink, $link ); |
| 241 | + } else { |
| 242 | + // broken?? |
| 243 | + } |
| 244 | + break; |
| 245 | + |
| 246 | + case 'newusers': |
| 247 | + switch( $entry->getSubtype() ) { |
| 248 | + case 'newusers': |
| 249 | + case 'create': |
| 250 | + $text = wfMsg( 'newuserlog-create-entry' /* no params */ ); |
| 251 | + break; |
| 252 | + case 'create2': |
| 253 | + $text = wfMsg( 'newuserlog-create2-entry', $target ); |
| 254 | + break; |
| 255 | + case 'autocreate': |
| 256 | + $text = wfMsg( 'newuserlog-autocreate-entry' /* no params */ ); |
| 257 | + break; |
| 258 | + } |
| 259 | + break; |
| 260 | + |
| 261 | + // case 'suppress' --private log -- aaron (sign your messages so we know who to blame in a few years :-D) |
| 262 | + // default: |
| 263 | + } |
| 264 | + if( is_null( $text ) ) { |
| 265 | + $text = $this->getPlainActionText(); |
| 266 | + } |
| 267 | + |
| 268 | + $this->plaintext = false; |
| 269 | + return $text; |
| 270 | + } |
| 271 | + |
| 272 | + /** |
145 | 273 | * Gets the log action, including username. |
146 | 274 | * @return string HTML |
147 | 275 | */ |
— | — | @@ -183,8 +311,8 @@ |
184 | 312 | protected function getMessageKey() { |
185 | 313 | $type = $this->entry->getType(); |
186 | 314 | $subtype = $this->entry->getSubtype(); |
187 | | - $key = "logentry-$type-$subtype"; |
188 | | - return $key; |
| 315 | + |
| 316 | + return "logentry-$type-$subtype"; |
189 | 317 | } |
190 | 318 | |
191 | 319 | /** |
Index: branches/wmf/1.19wmf1/includes/logging/LogPage.php |
— | — | @@ -100,7 +100,7 @@ |
101 | 101 | RecentChange::notifyLog( |
102 | 102 | $now, $titleObj, $this->doer, $this->getRcComment(), '', |
103 | 103 | $this->type, $this->action, $this->target, $this->comment, |
104 | | - $this->params, $newId |
| 104 | + $this->params, $newId, $this->getRcCommentIRC() |
105 | 105 | ); |
106 | 106 | } elseif( $this->sendToUDP ) { |
107 | 107 | # Don't send private logs to UDP |
— | — | @@ -114,7 +114,7 @@ |
115 | 115 | $rc = RecentChange::newLogEntry( |
116 | 116 | $now, $titleObj, $this->doer, $this->getRcComment(), '', |
117 | 117 | $this->type, $this->action, $this->target, $this->comment, |
118 | | - $this->params, $newId |
| 118 | + $this->params, $newId, $this->getRcCommentIRC() |
119 | 119 | ); |
120 | 120 | $rc->notifyRC2UDP(); |
121 | 121 | } |
— | — | @@ -141,6 +141,25 @@ |
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
| 145 | + * Get the RC comment from the last addEntry() call for IRC |
| 146 | + * |
| 147 | + * @return string |
| 148 | + */ |
| 149 | + public function getRcCommentIRC() { |
| 150 | + $rcComment = $this->ircActionText; |
| 151 | + |
| 152 | + if( $this->comment != '' ) { |
| 153 | + if ( $rcComment == '' ) { |
| 154 | + $rcComment = $this->comment; |
| 155 | + } else { |
| 156 | + $rcComment .= wfMsgForContent( 'colon-separator' ) . $this->comment; |
| 157 | + } |
| 158 | + } |
| 159 | + |
| 160 | + return $rcComment; |
| 161 | + } |
| 162 | + |
| 163 | + /** |
145 | 164 | * Get the comment from the last addEntry() call |
146 | 165 | */ |
147 | 166 | public function getComment() { |
— | — | @@ -461,6 +480,7 @@ |
462 | 481 | $formatter->setContext( $context ); |
463 | 482 | |
464 | 483 | $this->actionText = $formatter->getPlainActionText(); |
| 484 | + $this->ircActionText = $formatter->getIRCActionText(); |
465 | 485 | |
466 | 486 | return $this->saveContent(); |
467 | 487 | } |
Property changes on: branches/wmf/1.19wmf1/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
468 | 488 | Merged /trunk/phase3/includes:r112045-112046,112049,112061-112063,112065-112066,112070-112071 |
Property changes on: branches/wmf/1.19wmf1 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
469 | 489 | Merged /trunk/phase3:r112045-112046,112049,112061-112063,112065-112066,112070-112071 |