Haritha28 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/274980

Change subject: Merge "Try and avoid race conditions with thank-you-edit 
notifications"
......................................................................

Merge "Try and avoid race conditions with thank-you-edit notifications"

Change-Id: Icb5beaddf2151d2e08ed68be8554847a6436f3ca
---
M Echo.php
M Hooks.php
M i18n/en.json
M i18n/qqq.json
4 files changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/80/274980/1

diff --git a/Echo.php b/Echo.php
index dd24a9b..917181c 100644
--- a/Echo.php
+++ b/Echo.php
@@ -80,6 +80,7 @@
 $wgHooks['ParserTestTables'][] = 'EchoHooks::onParserTestTables';
 $wgHooks['EmailUserComplete'][] = 'EchoHooks::onEmailUserComplete';
 $wgHooks['LoginFormValidErrorMessages'][] = 
'EchoHooks::onLoginFormValidErrorMessages';
+$wgHooks['BlockIpComplete'][] = 'EchoHooks::onBlockIpComplete';
 
 // Extension:UserMerge support
 $wgHooks['UserMergeAccountFields'][] = 'EchoHooks::onUserMergeAccountFields';
diff --git a/Hooks.php b/Hooks.php
index b326795..a4f7d9e 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -600,7 +600,7 @@
                        return true;
                }
 
-               if ( $add || $remove ) {
+               if ( $add || $remove || $block) {
                        EchoEvent::create(
                                array(
                                        'type' => 'user-rights',
@@ -610,6 +610,7 @@
                                                'add' => $add,
                                                'remove' => $remove,
                                                'reason' => $reason,
+                                               'block' => $block,
                                        ),
                                        'agent' => $performer,
                                )
@@ -1171,6 +1172,9 @@
                global $wgEchoMaxNotificationCount;
                $vars['wgEchoMaxNotificationCount'] = 
$wgEchoMaxNotificationCount;
                return true;
+
+       public static function onBlockComplete( Block $block,   User $user ) {
+               return  $block;
        }
 
 }
diff --git a/i18n/en.json b/i18n/en.json
index 4e5269e..97ae056 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -94,6 +94,7 @@
        "notification-header-mention-article-talkpage": "$1 
{{GENDER:$2|mentioned}} {{GENDER:$3|you}} on the '''$4''' talk page in 
\"'''$5'''\".",
        "notification-header-mention-article-talkpage-nosection": "$1 
{{GENDER:$2|mentioned}} {{GENDER:$3|you}} on the '''$4''' talk page.",
        "notification-user-rights-add": "You are now a member of 
{{PLURAL:$2|this group|these groups}}: $1",
+       "notification-user-rights-block": "{{GENDER:$1|You}} have been 
blocked.",
        "notification-user-rights-remove": "You are no longer a member of 
{{PLURAL:$2|this group|these groups}}: $1",
        "notification-user-rights": "Your user rights 
[[Special:Log/rights/$1|were {{GENDER:$1|changed}}]] by [[User:$1|$1]]. $2. 
[[Special:ListGroupRights|Learn more]]",
        "notification-header-user-rights-add-only": "{{GENDER:$4|Your}} user 
rights were {{GENDER:$1|changed}}. You have been added to: $2.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 3e4cacf..034af82 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -115,6 +115,7 @@
        "notification-header-mention-article-talkpage": "Header text for a 
notification when you are mentioned by another user in a section on an article 
talk page.\n* $1 - user's name (not suitable for GENDER).\n* $2 - user's name 
for use in GENDER.\n* $3 - name of the user viewing the notification, can be 
used for GENDER\n* $4 - name of the article whose talk page you are mentioned 
in (without namespace).\n* $5 - name of the section they were mentioned in",
        "notification-header-mention-article-talkpage-nosection": "Header text 
for a notification when you are mentioned by another user on an article talk 
page.\n* $1 - user's name (not suitable for GENDER).\n* $2 - user's name for 
use in GENDER.\n* $3 - name of the user viewing the notification, can be used 
for GENDER\n* $4 - name of the article whose talk page you are mentioned in 
(without namespace)",
        "notification-user-rights-add": "Message indicating that a user was 
added to a user group.  Parameters:\n* $1 - a comma separated list of user 
group names\n* $2 - the number of user groups, this is used for PLURAL 
support\nSee also:\n* {{msg-mw|Notification-user-rights-remove}}",
+       "notification-user-rights-block": "Message indicating that a user has 
been blocked. \n* $1 - name user who has been blocked, can be used for GENDER",
        "notification-user-rights-remove": "Message indicating that a user was 
removed from a user group. Parameters:\n* $1 - a comma separated list of user 
group names\n* $2 - the number of user groups, this is used for PLURAL 
support\nSee also:\n* {{msg-mw|Notification-user-rights-add}}",
        "notification-user-rights": "Format for displaying notifications of a 
user right change in notification page.\n\nParameters:\n* $1 - the username of 
the person who made the user right change. Can be used for GENDER support.\n* 
$2 - a semicolon separated list of {{msg-mw|Notification-user-rights-add}}, 
{{msg-mw|Notification-user-rights-remove}}",
        "notification-header-user-rights-add-only": "Notifications header 
message when a user is added to groups.  Parameters:\n* $1 - the raw username 
of the person who made the user rights change, can be used for GENDER 
support\n* $2 - a localized list of the groups that were added\n* $3 - the 
number of groups that were added, can be used for PLURAL\n* $4 - name of the 
user viewing the notification, can be used for GENDER",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb5beaddf2151d2e08ed68be8554847a6436f3ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Haritha28 <[email protected]>

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

Reply via email to