mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-28 01:30:15 +00:00
Merge "Never show a negative number in the notifications badge"
This commit is contained in:
commit
ebe216e4c1
|
@ -787,6 +787,10 @@ class EchoHooks {
|
||||||
$msgCount = $notifUser->getMessageCount() - $subtractMessages;
|
$msgCount = $notifUser->getMessageCount() - $subtractMessages;
|
||||||
$alertCount = $notifUser->getAlertCount() - $subtractAlerts;
|
$alertCount = $notifUser->getAlertCount() - $subtractAlerts;
|
||||||
|
|
||||||
|
// But make sure we never show a negative number (T130853)
|
||||||
|
$msgCount = max( 0, $msgCount );
|
||||||
|
$alertCount = max( 0, $alertCount );
|
||||||
|
|
||||||
$msgNotificationTimestamp = $notifUser->getLastUnreadMessageTime();
|
$msgNotificationTimestamp = $notifUser->getLastUnreadMessageTime();
|
||||||
$alertNotificationTimestamp = $notifUser->getLastUnreadAlertTime();
|
$alertNotificationTimestamp = $notifUser->getLastUnreadAlertTime();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue