diff options
author | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-08-14 18:26:09 -0700 |
---|---|---|
committer | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-08-18 08:47:14 -0700 |
commit | f2b06cfc7c847f687582b1855959fdd885e3fac8 (patch) | |
tree | a92fa666bd612dd077378d02db6dfd84bc28ff1b /web/react/utils/utils.jsx | |
parent | 56eeb2f6efd04a8ff7b9f6aec18cda5089db1b28 (diff) | |
download | chat-f2b06cfc7c847f687582b1855959fdd885e3fac8.tar.gz chat-f2b06cfc7c847f687582b1855959fdd885e3fac8.tar.bz2 chat-f2b06cfc7c847f687582b1855959fdd885e3fac8.zip |
Added feature to the 'More...' PM channel list and fixed small cosmetic issues
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r-- | web/react/utils/utils.jsx | 15 |
1 files changed, 14 insertions, 1 deletions
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; +}; |