Kaldari has uploaded a new change for review.

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


Change subject: Making sure notification counts are reset on prefs changes
......................................................................

Making sure notification counts are reset on prefs changes

Bug: 47131
Change-Id: I5244ef9f7bf9d1217c0c0df6691d8cf689c47cf5
---
M Echo.php
M Hooks.php
2 files changed, 13 insertions(+), 0 deletions(-)


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

diff --git a/Echo.php b/Echo.php
index 60868e9..ec22895 100644
--- a/Echo.php
+++ b/Echo.php
@@ -175,6 +175,7 @@
 $wgHooks['ArticleSaveComplete'][] = 'EchoHooks::onArticleSaved';
 $wgHooks['AddNewAccount'][] = 'EchoHooks::onAccountCreated';
 $wgHooks['ArticleRollbackComplete'][] = 'EchoHooks::onRollbackComplete';
+$wgHooks['UserSaveSettings'][] = 'EchoHooks::onUserSaveSettings';
 
 // Disable ordinary user talk page email notifications
 $wgHooks['AbortEmailNotification'][] = 'EchoHooks::disableStandUserTalkEnotif';
diff --git a/Hooks.php b/Hooks.php
index 9616228..3305b8f 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -697,4 +697,16 @@
 
                return true;
        }
+
+       /**
+        * Handler for UserSaveSettings hook.
+        * @see http://www.mediawiki.org/wiki/Manual:Hooks/UserSaveSettings
+        * @param $user User whose settings were saved
+        * @return bool true in all cases
+        */
+       static function onUserSaveSettings( $user ) {
+               // Reset the notification count since it may have changed due 
to prefs changes.
+               EchoNotificationController::resetNotificationCount( $user, 
DB_MASTER );
+               return true;
+       }
 }

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

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

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

Reply via email to