diff options
author | Corey Hulen <corey@hulen.com> | 2015-07-01 22:19:58 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-07-01 22:19:58 -0800 |
commit | d3efefba1f7d4c5f09f61227c49db9229cc65553 (patch) | |
tree | f122ed069ce178429b131eb4ede31209d83e86c5 /web/react/utils/utils.jsx | |
parent | 03d7fb1ff276393f79923f06570035389b7ed261 (diff) | |
parent | fd310e382a2cc1a9779ef28dee7fea9476bb425f (diff) | |
download | chat-d3efefba1f7d4c5f09f61227c49db9229cc65553.tar.gz chat-d3efefba1f7d4c5f09f61227c49db9229cc65553.tar.bz2 chat-d3efefba1f7d4c5f09f61227c49db9229cc65553.zip |
Merge pull request #92 from nickago/MM-1151
MM-1151 clickable search results
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r-- | web/react/utils/utils.jsx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 70a47742f..530166f04 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -2,6 +2,7 @@ // See License.txt for license information. var AppDispatcher = require('../dispatcher/app_dispatcher.jsx'); +var ChannelStore = require('../stores/channel_store.jsx') var UserStore = require('../stores/user_store.jsx'); var Constants = require('../utils/constants.jsx'); var ActionTypes = Constants.ActionTypes; @@ -726,6 +727,23 @@ module.exports.isComment = function(post) { return false; } +module.exports.getDirectTeammate = function(channel_id) { + var userIds = ChannelStore.get(channel_id).name.split('__'); + + if(userIds.length != 2) { + return; + } + + var curUser = UserStore.getCurrentId(); + + for(var idx in userIds) { + if(userIds[idx] === curUser) + delete userIds[idx]; + } + + return UserStore.getProfile(userIds[0]) +} + Image.prototype.load = function(url, progressCallback) { var thisImg = this; var xmlHTTP = new XMLHttpRequest(); |