From f2b06cfc7c847f687582b1855959fdd885e3fac8 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Fri, 14 Aug 2015 18:26:09 -0700 Subject: Added feature to the 'More...' PM channel list and fixed small cosmetic issues --- web/react/utils/utils.jsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'web/react/utils/utils.jsx') diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 32793809d..f1fd3da67 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -964,4 +964,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; +}; -- cgit v1.2.3-1-g7c22