diff options
author | Corey Hulen <corey@hulen.com> | 2015-08-18 21:19:15 -0700 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-08-18 21:19:15 -0700 |
commit | 5bf1aac6970166a565bee74c24aeba551940991c (patch) | |
tree | 13590cfa2eea5dd95970458b377256d82e05a9a1 /web/react/utils/utils.jsx | |
parent | 44464f8f3c99ea4bae744a45e2924330a72f9b17 (diff) | |
parent | f2b06cfc7c847f687582b1855959fdd885e3fac8 (diff) | |
download | chat-5bf1aac6970166a565bee74c24aeba551940991c.tar.gz chat-5bf1aac6970166a565bee74c24aeba551940991c.tar.bz2 chat-5bf1aac6970166a565bee74c24aeba551940991c.zip |
Merge pull request #383 from rgarmsen2295/mm-1584b
MM-1584 Private message channels no longer do a page refresh on creation/first use
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 3f7d204e4..618cc1557 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -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; +}; |