r112045 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112044‎ | r112045 | r112046 >
Date:21:26, 21 February 2012
Author:reedy
Status:resolved
Tags:
Comment:
First merge of the rest of the code from bug 34508 patch 1 and patch 3
Modified paths:
  • /trunk/phase3/includes/logging/LogEntry.php (modified) (history)
  • /trunk/phase3/includes/logging/LogFormatter.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/logging/LogEntry.php
@@ -462,7 +462,7 @@
463463 $this->getTimestamp(),
464464 $logpage,
465465 $user,
466 - $formatter->getPlainActionText(), // Used for IRC feeds
 466+ $formatter->getIRCActionText(), // Used for IRC feeds
467467 $user->isAnon() ? $user->getName() : '',
468468 $this->getType(),
469469 $this->getSubtype(),
Index: trunk/phase3/includes/logging/LogFormatter.php
@@ -77,6 +77,8 @@
7878 */
7979 protected $plaintext = false;
8080
 81+ protected $irctext = false;
 82+
8183 protected function __construct( LogEntry $entry ) {
8284 $this->entry = $entry;
8385 $this->context = RequestContext::getMain();
@@ -141,6 +143,39 @@
142144 }
143145
144146 /**
 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 getIRCActionText() {
 153+ $this->irctext = true;
 154+ $this->plaintext = true;
 155+ $text = $this->getActionText();
 156+
 157+ // wfRunHooks( 'LogEntry::publish', array( $this, $formatter, &$actionText ) );
 158+ // function efLegacyLogsIrcFormat( $entry, $formatter, &$text ) {
 159+
 160+ $entry = $this->entry;
 161+ $parameters = $entry->getParameters();
 162+ switch ( $this->entry ) {
 163+ case 'move':
 164+ if ( $this->entry->getSubtype() === 'move_redir' ) {
 165+ $movesource = $parameters['4::target'];
 166+ $movetarget = $entry->getTarget()->getText();
 167+ $text = wfMsg( '1movedto2_redir', $movesource, $movetarget );
 168+ }
 169+ break;
 170+ // case 'delete':
 171+ // break
 172+ }
 173+
 174+ $this->plaintext = false;
 175+ $this->irctext = false;
 176+ return $text;
 177+ }
 178+
 179+ /**
145180 * Gets the log action, including username.
146181 * @return string HTML
147182 */
@@ -183,7 +218,13 @@
184219 protected function getMessageKey() {
185220 $type = $this->entry->getType();
186221 $subtype = $this->entry->getSubtype();
187 - $key = "logentry-$type-$subtype";
 222+ if( $this->irctext ) {
 223+ $key = "logentry-irc-$type-$subtype";
 224+ }
 225+ else {
 226+ $key = "logentry-$type-$subtype";
 227+ }
 228+
188229 return $key;
189230 }
190231

Follow-up revisions

RevisionCommit summaryAuthorDate
r112049Effectively revert r112042...reedy21:54, 21 February 2012
r112061Bug 34508 - [Regression] IRC string output for log messages no longer compatible...reedy23:38, 21 February 2012
r112073MFT r112045, r112046, r112049, r112061, r112062, r112063, r112065, r112066, r...reedy00:54, 22 February 2012
r112128r112045/bug 34508: Make upload/upload and overwrite match old IRC formatrobla18:29, 22 February 2012
r112415basic tests for bug 34508hashar21:22, 25 February 2012
r112561[IRC Log Message] Fix for protect/protect and protect/modify...krinkle01:56, 28 February 2012
r112639MFT r112045, r112046, r112049, r112061, r112066, r112079, r112128reedy21:08, 28 February 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112042Part 1 for bug 34508, commit all the messages added in patch 3reedy21:12, 21 February 2012

Status & tagging log