PLT-2707 Adding option to show DM list from all of server (#2871)

* PLT-2707 Adding option to show DM list from all of server

* Fixing loc
Этот коммит содержится в:
Corey Hulen
2016-05-04 06:31:42 -07:00
коммит произвёл Christopher Speller
родитель 6b06f49e89
Коммит 6611229cd7
29 изменённых файлов: 505 добавлений и 72 удалений

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

@@ -224,6 +224,28 @@ export function getTeamMembers(teamId) {
);
}
export function getProfilesForDirectMessageList() {
if (isCallInProgress('getProfilesForDirectMessageList')) {
return;
}
callTracker.getProfilesForDirectMessageList = utils.getTimestamp();
Client.getProfilesForDirectMessageList(
(data) => {
callTracker.getProfilesForDirectMessageList = 0;
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_PROFILES_FOR_DM_LIST,
profiles: data
});
},
(err) => {
callTracker.getProfilesForDirectMessageList = 0;
dispatchError(err, 'getProfilesForDirectMessageList');
}
);
}
export function getProfiles() {
if (isCallInProgress('getProfiles')) {
return;

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

@@ -60,6 +60,7 @@ export default {
RECEIVED_MENTION_DATA: null,
RECEIVED_ADD_MENTION: null,
RECEIVED_PROFILES_FOR_DM_LIST: null,
RECEIVED_PROFILES: null,
RECEIVED_DIRECT_PROFILES: null,
RECEIVED_ME: null,

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

@@ -1247,6 +1247,13 @@ export function openDirectChannelToUser(user, successCb, errorCb) {
'true'
);
// if the user in another team and isn't already in the direct message
// list then we should add him so his name shows up correctly.
var profileUser = UserStore.getProfile(user.id);
if (!profileUser) {
UserStore.getDirectProfiles()[user.id] = user;
}
const channelName = this.getDirectChannelName(UserStore.getCurrentId(), user.id);
let channel = ChannelStore.getByName(channelName);