jenkins-bot has submitted this change and it was merged.

Change subject: Add a required footer to all messages
......................................................................


Add a required footer to all messages

Individual wikis can customize the "massmessage-message-footer"
message to add a footer to any message sent *from* that
project.

Change-Id: I680141519675bf6b7bdcc8075d6feb0e6fc104a7
---
M MassMessage.i18n.php
M SpecialMassMessage.php
2 files changed, 9 insertions(+), 0 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/MassMessage.i18n.php b/MassMessage.i18n.php
index e27cdc1..f884a0b 100644
--- a/MassMessage.i18n.php
+++ b/MassMessage.i18n.php
@@ -38,6 +38,7 @@
        'logentry-massmessage-send' => '$1 {{GENDER:$2|sent a message}} to $3',
        'logentry-massmessage-failure' => 'Delivery of "$4" to $3 failed with 
an error code of <code>$5</code>',
        'massmessage-cannot-rename' => 'This is a system account and cannot be 
renamed.',
+       'massmessage-message-footer' => '',
 );
 
 /** Message documentation (Message documentation)
@@ -90,6 +91,7 @@
 * $4 is the subject line of the message
 * $5 is the API error code. This will always be in English.',
        'massmessage-cannot-rename' => 'Error message a user sees when they try 
renaming the bot account.',
+       'massmessage-message-footer' => 'The footer that is by added at the end 
of very message. It is left blank so individual wikis can customize it.',
 );
 
 /** Bengali (বাংলা)
diff --git a/SpecialMassMessage.php b/SpecialMassMessage.php
index c8fe026..8d900d7 100644
--- a/SpecialMassMessage.php
+++ b/SpecialMassMessage.php
@@ -158,6 +158,13 @@
                        return $this->status;
                }
 
+               // Add a global footer
+               $footer = $this->msg( 'massmessage-message-footer' 
)->inContentLanguage()->parse();
+               if ( trim( $footer ) ) {
+                       // Only add the footer if it is not just whitespace
+                       $data['message'] .= "\n" . $footer;
+               }
+
                if ( $this->state == 'submit' ) {
                        return $this->submit( $data );
                } else { // $this->state can only be 'preview' here

-- 
To view, visit https://gerrit.wikimedia.org/r/82570
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I680141519675bf6b7bdcc8075d6feb0e6fc104a7
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: MZMcBride <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to