From 1fa3f2351c98e4d1b9c198e357d90ac0d436dcaa Mon Sep 17 00:00:00 2001
From: George Goldberg <george@gberg.me>
Date: Tue, 4 Apr 2017 20:17:15 +0100
Subject: PLT-6023: Add Users to Team in WebApp. (#5956)

* PLT-6198: Use added to channel system message on default channels.

Use a different sytem message when a user was added to a default channel
by someone else than when they joined themselves.

* PLT-6023: Add Users to Team in WebApp.

* Fix string text.

* Handle added_to_team websocket message.

* Fix unread flag on new channel.
---
 webapp/stores/team_store.jsx | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'webapp/stores/team_store.jsx')

diff --git a/webapp/stores/team_store.jsx b/webapp/stores/team_store.jsx
index 6f81a9345..a77527d37 100644
--- a/webapp/stores/team_store.jsx
+++ b/webapp/stores/team_store.jsx
@@ -252,6 +252,12 @@ class TeamStoreClass extends EventEmitter {
         }
     }
 
+    removeMemberNotInTeam(teamId = this.getCurrentId(), userId) {
+        if (this.members_not_in_team[teamId]) {
+            Reflect.deleteProperty(this.members_not_in_team[teamId], userId);
+        }
+    }
+
     getMembersInTeam(teamId = this.getCurrentId()) {
         return Object.assign({}, this.members_in_team[teamId]) || {};
     }
@@ -365,6 +371,10 @@ TeamStore.dispatchToken = AppDispatcher.register((payload) => {
         TeamStore.saveMyTeam(action.team);
         TeamStore.emitChange();
         break;
+    case ActionTypes.RECEIVED_TEAM:
+        TeamStore.saveTeam(action.team);
+        TeamStore.emitChange();
+        break;
     case ActionTypes.CREATED_TEAM:
         TeamStore.saveTeam(action.team);
         TeamStore.appendMyTeamMember(action.member);
-- 
cgit v1.2.3-1-g7c22

