From 20f091982cb300bb6eca1e16b4c41877dfe91597 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Tue, 1 Mar 2016 16:45:37 -0800 Subject: [PATCH] Don't list foreign notifications for both sections when not using groupbysection API requests with notgroupbysection disabled but notsection set to 'alert' would return foreign notification bundles for both alerts and messages, separately. The frontend always pasess notgroupbysection=1 in practice because notmessageunreadfirst=1 doesn't work without it; but regardless of that, the API module shouldn't return a foreign notification bundle for messages when only alerts are requested. Change-Id: I9fa6d1411a8c121591ce6dd75ee8052bcdcb478b --- includes/api/ApiEchoNotifications.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/api/ApiEchoNotifications.php b/includes/api/ApiEchoNotifications.php index 435313438..e3caaed79 100644 --- a/includes/api/ApiEchoNotifications.php +++ b/includes/api/ApiEchoNotifications.php @@ -70,7 +70,7 @@ class ApiEchoNotifications extends ApiQueryBase { if ( $foreignNotifications ) { // insert fake notifications for foreign notifications - foreach ( EchoAttributeManager::$sections as $i => $section ) { + foreach ( $params['sections'] as $i => $section ) { if ( $foreignNotifications->getCount( $section ) > 0 ) { $result['list'][-$i-1] = $this->makeForeignNotification( $user, $params['format'], $foreignNotifications, $section ); }