diff --git a/i18n/en.json b/i18n/en.json index a7fac9859..eadb4ec8e 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -186,9 +186,10 @@ "apihelp-query+notifications-param-index": "If specified, a list of notification IDs, in order, will be returned.", "apihelp-query+notifications-param-noforn": "True to opt out of data about notifications on foreign wikis.", "apihelp-query+notifications-param-alertcontinue": "When more alert results are available, use this to continue.", - "apihelp-query+notifications-param-alertunreadfirst": "Whether to show unread message notifications first.", + "apihelp-query+notifications-param-unreadfirst": "Whether to show unread notifications first (only used if groupbysection is not set).", + "apihelp-query+notifications-param-alertunreadfirst": "Whether to show unread message notifications first (only used if groupbysection is set).", "apihelp-query+notifications-param-messagecontinue": "When more message results are available, use this to continue.", - "apihelp-query+notifications-param-messageunreadfirst": "Whether to show unread alert notifications first.", + "apihelp-query+notifications-param-messageunreadfirst": "Whether to show unread alert notifications first (only used if groupbysection is set).", "apihelp-query+notifications-example-1": "List notifications", "apihelp-query+notifications-example-2": "List notifications, grouped by section, with counts" } diff --git a/i18n/qqq.json b/i18n/qqq.json index c94582b6f..0fb3e7822 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -206,6 +206,7 @@ "apihelp-query+notifications-param-limit": "{{doc-apihelp-param|query+notifications|limit}}", "apihelp-query+notifications-param-index": "{{doc-apihelp-param|query+notifications|index}}", "apihelp-query+notifications-param-noforn": "{{doc-apihelp-param|query+notifications|noforn}}", + "apihelp-query+notifications-param-unreadfirst": "{{doc-apihelp-param|query+notifications|unreadfirst}}", "apihelp-query+notifications-param-alertcontinue": "{{doc-apihelp-param|query+notifications|alertcontinue}}", "apihelp-query+notifications-param-alertunreadfirst": "{{doc-apihelp-param|query+notifications|alertunreadfirst}}", "apihelp-query+notifications-param-messagecontinue": "{{doc-apihelp-param|query+notifications|messagecontinue}}", diff --git a/includes/api/ApiEchoNotifications.php b/includes/api/ApiEchoNotifications.php index e3caaed79..230e8678a 100644 --- a/includes/api/ApiEchoNotifications.php +++ b/includes/api/ApiEchoNotifications.php @@ -65,7 +65,7 @@ class ApiEchoNotifications extends ApiQueryBase { $result = $this->getPropList( $user, $attributeManager->getUserEnabledEventsbySections( $user, 'web', $params['sections'] ), - $params['filter'], $params['limit'], $params['continue'], $params['format'] + $params['filter'], $params['limit'], $params['continue'], $params['format'], $params['unreadfirst'] ); if ( $foreignNotifications ) { @@ -368,6 +368,10 @@ class ApiEchoNotifications extends ApiQueryBase { 'continue' => array( ApiBase::PARAM_HELP_MSG => 'api-help-param-continue', ), + 'unreadfirst' => array( + ApiBase::PARAM_TYPE => 'boolean', + ApiBase::PARAM_DFLT => false, + ), ); foreach ( $sections as $section ) { $params[$section . 'continue'] = null;