PLT-5012 Combine updateLastViewedAt, setLastViewedAt and setActiveChannel into a single API (#4840)

* Combine updateLastViewedAt, setLastViewedAt and setActiveChannel into a single API

* Remove preference DB writes
Этот коммит содержится в:
Joram Wilander
2016-12-21 16:35:01 -05:00
коммит произвёл Christopher Speller
родитель 139cb52c99
Коммит ba6e370ca7
17 изменённых файлов: 386 добавлений и 276 удалений

Просмотреть файл

@@ -1187,6 +1187,7 @@ export default class Client {
end(this.handleResponse.bind(this, 'getStatuses', success, error));
}
// SCHEDULED FOR DEPRECATION IN 3.8 - use viewChannel instead
setActiveChannel(id, success, error) {
request.
post(`${this.getUsersRoute()}/status/set_active_channel`).
@@ -1366,6 +1367,17 @@ export default class Client {
this.track('api', 'api_channels_delete');
}
viewChannel(channelId, prevChannelId = '', time = 0, success, error) {
request.
post(`${this.getChannelsRoute()}/view`).
set(this.defaultHeaders).
type('application/json').
accept('application/json').
send({channel_id: channelId, prev_channel_id: prevChannelId, time}).
end(this.handleResponse.bind(this, 'viewChannel', success, error));
}
// SCHEDULED FOR DEPRECATION IN 3.8 - use viewChannel instead
updateLastViewedAt(channelId, active, success, error) {
request.
post(`${this.getChannelNeededRoute(channelId)}/update_last_viewed_at`).
@@ -1376,6 +1388,7 @@ export default class Client {
end(this.handleResponse.bind(this, 'updateLastViewedAt', success, error));
}
// SCHEDULED FOR DEPRECATION IN 3.8 - use viewChannel instead
setLastViewedAt(channelId, lastViewedAt, success, error) {
request.
post(`${this.getChannelNeededRoute(channelId)}/set_last_viewed_at`).