mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-01 02:46:46 +00:00
Remove markread action from the read API
Don't merge till parent patch 84468 is merged and deployed Change-Id: I863cf068754723701c26ba575c94a9852cac240e
This commit is contained in:
parent
2b57fbd3c2
commit
e19e8cd5b5
|
@ -18,21 +18,6 @@ class ApiEchoNotifications extends ApiQueryBase {
|
||||||
|
|
||||||
$params = $this->extractRequestParams();
|
$params = $this->extractRequestParams();
|
||||||
|
|
||||||
// @Todo - markread/markallread has been migrated to a separate new API module,
|
|
||||||
// any related code in this API should be removed in a follow-up patch so that
|
|
||||||
// anything integrated with markread will have time to switch to the new markread
|
|
||||||
// API, also to give client js code enough time to refresh
|
|
||||||
//
|
|
||||||
// There is no need to trigger markRead if all notifications are read
|
|
||||||
if ( $notifUser->getNotificationCount() > 0 ) {
|
|
||||||
if ( count( $params['markread'] ) ) {
|
|
||||||
// Make sure there is a limit to the update
|
|
||||||
$notifUser->markRead( array_slice( $params['markread'], 0, ApiBase::LIMIT_SML2 ) );
|
|
||||||
} elseif ( $params['markallread'] ) {
|
|
||||||
$notifUser->markAllRead();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$prop = $params['prop'];
|
$prop = $params['prop'];
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
|
@ -181,15 +166,6 @@ class ApiEchoNotifications extends ApiQueryBase {
|
||||||
),
|
),
|
||||||
ApiBase::PARAM_DFLT => 'list',
|
ApiBase::PARAM_DFLT => 'list',
|
||||||
),
|
),
|
||||||
'markread' => array(
|
|
||||||
ApiBase::PARAM_ISMULTI => true,
|
|
||||||
ApiBase::PARAM_DEPRECATED => true,
|
|
||||||
),
|
|
||||||
'markallread' => array(
|
|
||||||
ApiBase::PARAM_REQUIRED => false,
|
|
||||||
ApiBase::PARAM_TYPE => 'boolean',
|
|
||||||
ApiBase::PARAM_DEPRECATED => true,
|
|
||||||
),
|
|
||||||
'format' => array(
|
'format' => array(
|
||||||
ApiBase::PARAM_TYPE => array(
|
ApiBase::PARAM_TYPE => array(
|
||||||
'text',
|
'text',
|
||||||
|
@ -213,8 +189,6 @@ class ApiEchoNotifications extends ApiQueryBase {
|
||||||
public function getParamDescription() {
|
public function getParamDescription() {
|
||||||
return array(
|
return array(
|
||||||
'prop' => 'Details to request.',
|
'prop' => 'Details to request.',
|
||||||
'markread' => 'A list of notification IDs to mark as read',
|
|
||||||
'markallread' => "If set to true, marks all of a user's notifications as read",
|
|
||||||
'format' => 'If specified, notifications will be returned formatted this way.',
|
'format' => 'If specified, notifications will be returned formatted this way.',
|
||||||
'index' => 'If specified, a list of notification IDs, in order, will be returned.',
|
'index' => 'If specified, a list of notification IDs, in order, will be returned.',
|
||||||
'limit' => 'The maximum number of notifications to return.',
|
'limit' => 'The maximum number of notifications to return.',
|
||||||
|
@ -231,7 +205,6 @@ class ApiEchoNotifications extends ApiQueryBase {
|
||||||
return array(
|
return array(
|
||||||
'api.php?action=query&meta=notifications',
|
'api.php?action=query&meta=notifications',
|
||||||
'api.php?action=query&meta=notifications¬prop=count',
|
'api.php?action=query&meta=notifications¬prop=count',
|
||||||
'api.php?action=query&meta=notifications¬markread=8',
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue