summaryrefslogtreecommitdiffstats
path: root/webapp/client
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-12-21 16:35:01 -0500
committerChristopher Speller <crspeller@gmail.com>2016-12-21 16:35:01 -0500
commitba6e370ca71abacaa30234cb164427d27c86df13 (patch)
tree2379b6dab897deef1226f66772b8f05e0bb08f9c /webapp/client
parent139cb52c99ac525f44a280803447bbbd88369f23 (diff)
downloadchat-ba6e370ca71abacaa30234cb164427d27c86df13.tar.gz
chat-ba6e370ca71abacaa30234cb164427d27c86df13.tar.bz2
chat-ba6e370ca71abacaa30234cb164427d27c86df13.zip
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
Diffstat (limited to 'webapp/client')
-rw-r--r--webapp/client/client.jsx13
1 files changed, 13 insertions, 0 deletions
diff --git a/webapp/client/client.jsx b/webapp/client/client.jsx
index 3ec36644f..c5743ae7b 100644
--- a/webapp/client/client.jsx
+++ b/webapp/client/client.jsx
@@ -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`).