Merge pull request #383 from rgarmsen2295/mm-1584b

MM-1584 Private message channels no longer do a page refresh on creation/first use
Этот коммит содержится в:
Corey Hulen
2015-08-18 21:19:15 -07:00
родитель 44464f8f3c f2b06cfc7c
Коммит 5bf1aac697
5 изменённых файлов: 152 добавлений и 52 удалений

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

@@ -968,4 +968,17 @@ module.exports.generateId = function() {
module.exports.isBrowserFirefox = function() {
return navigator && navigator.userAgent && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
}
};
// Used to get the id of the other user from a DM channel
module.exports.getUserIdFromChannelName = function(channel) {
var ids = channel.name.split('__');
var otherUserId = '';
if (ids[0] === UserStore.getCurrentId()) {
otherUserId = ids[1];
} else {
otherUserId = ids[0];
}
return otherUserId;
};