Matthias Mullie has uploaded a new change for review.

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

Change subject: Include cross-wiki notifications in serverside-rendered badge
......................................................................

Include cross-wiki notifications in serverside-rendered badge

getNotificationCount only includes the amount of local notifications.
getMessageCount & getAlertCount also include the count on foreign wikis.

Bug: T130662
Change-Id: I4d49b543a390294ac6550728d2453ca773efb044
---
M includes/skins/SkinMinerva.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/33/281933/1

diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index fc638ab..9a80505 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -283,7 +283,8 @@
                        $notificationsTitle = SpecialPage::getTitleFor( 
'Notifications' );
                        $notificationsMsg = $this->msg( 
'mobile-frontend-user-button-tooltip' )->text();
                        if ( $currentTitle->getPrefixedText() !== 
$notificationsTitle->getPrefixedText() ) {
-                               $count = MWEchoNotifUser::newFromUser( $user 
)->getNotificationCount();
+                               $notifUser = MWEchoNotifUser::newFromUser( 
$user );
+                               $count = $notifUser->getAlertCount() + 
$notifUser->getMessageCount();
                                $isZero = $count === 0;
                                $countLabel = 
EchoNotificationController::formatNotificationCount( $count );
                        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d49b543a390294ac6550728d2453ca773efb044
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>

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

Reply via email to