summaryrefslogtreecommitdiffstats
path: root/web/react/utils
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-12-08 09:45:21 -0500
committerhmhealey <harrisonmhealey@gmail.com>2015-12-08 09:45:21 -0500
commitc55e7895d91c9d4cd31c7cefe81319d64d7fed16 (patch)
treea68fa0fbc30109f3e9fb53e62c91cb091959dbb1 /web/react/utils
parent4b51490a3836144e6407b71cbd00aa094985168a (diff)
downloadchat-c55e7895d91c9d4cd31c7cefe81319d64d7fed16.tar.gz
chat-c55e7895d91c9d4cd31c7cefe81319d64d7fed16.tar.bz2
chat-c55e7895d91c9d4cd31c7cefe81319d64d7fed16.zip
Changed Sidebar direct channel list to be driven by preferences
Diffstat (limited to 'web/react/utils')
-rw-r--r--web/react/utils/utils.jsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index f80da8415..304713528 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -1137,6 +1137,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);
@@ -1252,4 +1257,4 @@ export function isFeatureEnabled(feature) {
export function isSystemMessage(post) {
return post.type && (post.type.lastIndexOf(Constants.SYSTEM_MESSAGE_PREFIX) === 0);
-} \ No newline at end of file
+}