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

Change subject: Don't send rollback notification if nothing changed
......................................................................


Don't send rollback notification if nothing changed

Bug: 56574
Change-Id: If727161560ee07482293e8c012b8ba90bb5df505
---
M Hooks.php
1 file changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/Hooks.php b/Hooks.php
index 758a1c5..13c24fc 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -789,7 +789,10 @@
        static function onRollbackComplete( $page, $agent, $newRevision, 
$oldRevision ) {
                $victimId = $oldRevision->getUser();
 
-               if ( $victimId ) { // No notifications for anonymous users
+               if (
+                       $victimId && // No notifications for anonymous users
+                       !$oldRevision->getContent()->equals( 
$newRevision->getContent() ) // No notifications for null rollbacks
+               ) {
                        EchoEvent::create( array(
                                'type' => 'reverted',
                                'title' => $page->getTitle(),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If727161560ee07482293e8c012b8ba90bb5df505
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <kren...@gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to