jenkins-bot has submitted this change and it was merged.
Change subject: Implements prop=listmembership
..
Implements prop=listmembership
Usage examples:
Watchlist (lsmid=0 or missing)
*
http://localhost:8080/w/api.php?action=query&prop=listmembership&titles=Main_Page&lsmid=0
Specific list, e.g. #7
*
http://localhost:8080/w/api.php?action=query&prop=listmembership&titles=Main_Page&lsmid=7
Obviously because this is a prop, generators can be used:
*
http://localhost:8080/w/api.php?action=query&prop=listmembership&generator=allpages&lsmid=0
Bug: T95516
Change-Id: I90b6df0c7a9d69460921e9410284c312b3d09d7b
---
M Gather.php
M i18n/en.json
M i18n/qqq.json
A includes/api/ApiMixinListAccess.php
A includes/api/ApiQueryListMembership.php
M includes/api/ApiQueryListPages.php
M tests/phpunit/api/GatherTests.php
7 files changed, 357 insertions(+), 66 deletions(-)
Approvals:
Yurik: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Gather.php b/Gather.php
index 28eb272..3eff5f6 100644
--- a/Gather.php
+++ b/Gather.php
@@ -67,8 +67,10 @@
'Gather\SpecialGatherLists' => 'specials/SpecialGatherLists',
'Gather\SpecialGatherEditFeed' => 'specials/SpecialGatherEditFeed',
+ 'Gather\api\ApiMixinListAccess' => 'api/ApiMixinListAccess',
'Gather\api\ApiEditList' => 'api/ApiEditList',
'Gather\api\ApiQueryLists' => 'api/ApiQueryLists',
+ 'Gather\api\ApiQueryListMembership' => 'api/ApiQueryListMembership',
'Gather\api\ApiQueryListPages' => 'api/ApiQueryListPages',
);
@@ -104,6 +106,7 @@
// Api
$wgAPIModules['editlist'] = 'Gather\api\ApiEditList';
$wgAPIListModules['lists'] = 'Gather\api\ApiQueryLists';
+$wgAPIPropModules['listmembership'] = 'Gather\api\ApiQueryListMembership';
$wgAPIListModules['listpages'] = 'Gather\api\ApiQueryListPages';
// Configuration
diff --git a/i18n/en.json b/i18n/en.json
index d98088b..165a5d5 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -116,5 +116,10 @@
"gather-collection-more": "View more pages in this collection",
"gather-add-to-another": "Show my other collections",
"gather-watchstar-button-label": "Add to collection",
- "gather-menu-guider": "Tap on the menu icon to take a look at your new
collection."
+ "gather-menu-guider": "Tap on the menu icon to take a look at your new
collection.",
+ "gather-api-help-param-listid": "List id; omit or set to 0 to use the
watchlist.",
+ "gather-api-help-param-listowner": "User ID of the list owner. Only
makes sense for watchlists.",
+ "gather-api-help-param-listtoken": "Watchlist token (see watchlist
API); required when looking at someone else's watchlist.",
+ "apihelp-query+listmembership-description": "Returns which of a set of
pages are in a given list.",
+ "apihelp-query+listmembership-example-1": "Check whether \"Page\" is on
the watchlist."
}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 4e888b0..4bf22cc 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -118,5 +118,10 @@
"gather-collection-more": "Label for link at bottom of Gather
collection when there are more than 50 items.",
"gather-add-to-another": "Label for button at bottom of collection
overlay for when you have more collections that you could potentially add to.",
"gather-watchstar-button-label": "A label for the button to add to a
collection.",
- "gather-menu-guider": "Message that shows up in an overlay pointing at
the menu button."
+ "gather-menu-guider": "Message that shows up in an overlay pointing at
the menu button.",
+ "gather-api-help-param-listid":
"{{doc-apihelp-param|lsm|id|listmembership|query+listmembership}}",
+ "gather-api-help-param-listowner":
"{{doc-apihelp-param|lsm|owner|listmembership|query+listmembership}}",
+ "gather-api-help-param-listtoken":
"{{doc-apihelp-param|lsm|token|listmembership|query+listmembership}}",
+ "apihelp-query+listmembership-description":
"{{doc-apihelp-description|lsm|listmembership|query+listmembership}}",
+ "apihelp-query+listmembership-example-1":
"{{doc-apihelp-example|lsm|listmembership|query+listmembership}}"
}
diff --git a/includes/api/ApiMixinListAccess.php
b/includes/api/ApiMixinListAccess.php
new file mode 100644
index 000..ddea2dc
--- /dev/null
+++ b/includes/api/ApiMixinListAccess.php
@@ -0,0 +1,123 @@
+@gmail.com",
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Y