From f32eb525f3fa0828a23f589d765c267e3b2aea86 Mon Sep 17 00:00:00 2001
From: Joram Wilander <jwawilander@gmail.com>
Date: Fri, 2 Sep 2016 12:50:15 -0400
Subject: Do not send push notifications for channels being actively viewed
 (#3931)

---
 webapp/client/client.jsx | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

(limited to 'webapp/client/client.jsx')

diff --git a/webapp/client/client.jsx b/webapp/client/client.jsx
index a059bb38a..80e2cfe3e 100644
--- a/webapp/client/client.jsx
+++ b/webapp/client/client.jsx
@@ -1003,6 +1003,16 @@ export default class Client {
             end(this.handleResponse.bind(this, 'getStatuses', success, error));
     }
 
+    setActiveChannel(id, success, error) {
+        request.
+            post(`${this.getUsersRoute()}/status/set_active_channel`).
+            set(this.defaultHeaders).
+            type('application/json').
+            accept('application/json').
+            send({channel_id: id}).
+            end(this.handleResponse.bind(this, 'setActiveChannel', success, error));
+    }
+
     verifyEmail(uid, hid, success, error) {
         request.
             post(`${this.getUsersRoute()}/verify_email`).
@@ -1172,12 +1182,13 @@ export default class Client {
         this.track('api', 'api_channels_delete');
     }
 
-    updateLastViewedAt(channelId, success, error) {
+    updateLastViewedAt(channelId, active, success, error) {
         request.
             post(`${this.getChannelNeededRoute(channelId)}/update_last_viewed_at`).
             set(this.defaultHeaders).
             type('application/json').
             accept('application/json').
+            send({active}).
             end(this.handleResponse.bind(this, 'updateLastViewedAt', success, error));
     }
 
-- 
cgit v1.2.3-1-g7c22

