Index: trunk/phase3/includes/logging/LogEntry.php |
— | — | @@ -462,7 +462,7 @@ |
463 | 463 | $this->getTimestamp(), |
464 | 464 | $logpage, |
465 | 465 | $user, |
466 | | - $formatter->getPlainActionText(), // Used for IRC feeds |
| 466 | + $formatter->getIRCActionText(), // Used for IRC feeds |
467 | 467 | $user->isAnon() ? $user->getName() : '', |
468 | 468 | $this->getType(), |
469 | 469 | $this->getSubtype(), |
Index: trunk/phase3/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,39 @@ |
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 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 | + /** |
145 | 180 | * Gets the log action, including username. |
146 | 181 | * @return string HTML |
147 | 182 | */ |
— | — | @@ -183,7 +218,13 @@ |
184 | 219 | protected function getMessageKey() { |
185 | 220 | $type = $this->entry->getType(); |
186 | 221 | $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 | + |
188 | 229 | return $key; |
189 | 230 | } |
190 | 231 | |