Page MenuHomePhabricator

bug34508.3.patch

Authored By
bzimport
Nov 22 2014, 12:11 AM
Size
4 KB
Referenced Files
None
Subscribers
None

bug34508.3.patch

Index: includes/logging/LogEntry.php
===================================================================
--- includes/logging/LogEntry.php (revision 111989)
+++ includes/logging/LogEntry.php (working copy)
@@ -462,7 +462,7 @@
$this->getTimestamp(),
$logpage,
$user,
- $formatter->getPlainActionText(), // Used for IRC feeds
+ $formatter->getIRCActionText(), // Used for IRC feeds
$user->isAnon() ? $user->getName() : '',
$this->getType(),
$this->getSubtype(),
Index: includes/logging/LogFormatter.php
===================================================================
--- includes/logging/LogFormatter.php (revision 111987)
+++ includes/logging/LogFormatter.php (working copy)
@@ -77,6 +77,8 @@
*/
protected $plaintext = false;
+ protected $irctext = false;
+
protected function __construct( LogEntry $entry ) {
$this->entry = $entry;
$this->context = RequestContext::getMain();
@@ -141,6 +143,28 @@
}
/**
+ * Even uglier hack to maintain backwards compatibilty with IRC bots
+ * (bug 34508).
+ * @see getActionText()
+ * @return string text
+ */
+ public function getIRCActionText() {
+ $this->irctext = true;
+ $this->plaintext = true;
+ $text = $this->getActionText();
+
+ $entry = $this->entry;
+ if ( $entry->getType() === 'delete' && $entry->getSubtype() === 'delete' ) {
+ if ( $this->canView( LogPage::DELETED_COMMENT ) ) {
+ $text .= ": " . $this->entry->getComment();
+ }
+ }
+ $this->plaintext = false;
+ $this->irctext = false;
+ return $text;
+ }
+
+ /**
* Gets the log action, including username.
* @return string HTML
*/
@@ -183,7 +207,13 @@
protected function getMessageKey() {
$type = $this->entry->getType();
$subtype = $this->entry->getSubtype();
- $key = "logentry-$type-$subtype";
+ if( $this->irctext ) {
+ $key = "logentry-irc-$type-$subtype";
+ }
+ else {
+ $key = "logentry-$type-$subtype";
+ }
+
return $key;
}
Index: languages/messages/MessagesEn.php
===================================================================
--- languages/messages/MessagesEn.php (revision 111324)
+++ languages/messages/MessagesEn.php (working copy)
@@ -4709,6 +4709,29 @@
'logentry-newusers-autocreate' => 'Account $1 was created automatically',
'newuserlog-byemail' => 'password sent by e-mail',
+# For IRC, see bug 34508. Do not change
+'logentry-irc-delete-delete' => 'deleted "$3"',
+'logentry-irc-delete-restore' => 'restored "$3"',
+'logentry-irc-delete-event' => '$1 changed visibility of {{PLURAL:$5|a log event|$5 log events}} on $3: $4',
+'logentry-irc-delete-revision' => '$1 changed visibility of {{PLURAL:$5|a revision|$5 revisions}} on page $3: $4',
+'logentry-irc-delete-event-legacy' => '$1 changed visibility of log events on $3',
+'logentry-irc-delete-revision-legacy' => '$1 changed visibility of revisions on page $3',
+'logentry-irc-suppress-delete' => '$1 suppressed page $3',
+'logentry-irc-suppress-event' => '$1 secretly changed visibility of {{PLURAL:$5|a log event|$5 log events}} on $3: $4',
+'logentry-irc-suppress-revision' => '$1 secretly changed visibility of {{PLURAL:$5|a revision|$5 revisions}} on page $3: $4',
+'logentry-irc-suppress-event-legacy' => '$1 secretly changed visibility of log events on $3',
+'logentry-irc-suppress-revision-legacy' => '$1 secretly changed visibility of revisions on page $3',
+'logentry-irc-move-move' => '$1 moved page $3 to $4',
+'logentry-irc-move-move-noredirect' => '$1 moved page $3 to $4 without leaving a redirect',
+'logentry-irc-move-move_redir' => 'moved $3 to $4 over redirect',
+'logentry-irc-move-move_redir-noredirect' => '$1 moved page $3 to $4 over a redirect without leaving a redirect',
+'logentry-irc-patrol-patrol' => '$1 marked revision $4 of page $3 patrolled',
+'logentry-irc-patrol-patrol-auto' => '$1 automatically marked revision $4 of page $3 patrolled',
+'logentry-irc-newusers-newusers' => '$1 created a user account',
+'logentry-irc-newusers-create' => '$1 created a user account',
+'logentry-irc-newusers-create2' => '$1 created a user account $3',
+'logentry-irc-newusers-autocreate' => 'Account $1 was created automatically',
+
# Feedback
'feedback-bugornote' => 'If you are ready to describe a technical problem in detail please [$1 report a bug].
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.',

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8406
Default Alt Text
bug34508.3.patch (4 KB)

Event Timeline