summaryrefslogtreecommitdiffstats
path: root/web/react/utils/utils.jsx
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-12-11 06:40:37 -0800
committerCorey Hulen <corey@hulen.com>2015-12-11 06:40:37 -0800
commit412b45431ac913d13fb211b693e177bc92a09ecf (patch)
tree74f7e329090541f18ab30c7bf62d21987be92629 /web/react/utils/utils.jsx
parent607a8151de502bf45de131ef3632c741ad452333 (diff)
parentc55e7895d91c9d4cd31c7cefe81319d64d7fed16 (diff)
downloadchat-412b45431ac913d13fb211b693e177bc92a09ecf.tar.gz
chat-412b45431ac913d13fb211b693e177bc92a09ecf.tar.bz2
chat-412b45431ac913d13fb211b693e177bc92a09ecf.zip
Merge pull request #1652 from hmhealey/plt1319
PLT-1319 Fixed direct channels not being visible when no actual channel exists
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r--web/react/utils/utils.jsx5
1 files changed, 5 insertions, 0 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index c2e4276b0..fb8b89252 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -1138,6 +1138,11 @@ export function getUserIdFromChannelName(channel) {
return otherUserId;
}
+// Returns true if the given channel is a direct channel between the current user and the given one
+export function isDirectChannelForUser(otherUserId, channel) {
+ return channel.type === Constants.DM_CHANNEL && getUserIdFromChannelName(channel) === otherUserId;
+}
+
export function importSlack(file, success, error) {
var formData = new FormData();
formData.append('file', file, file.name);