From ea99cedb62a308415d9558badaf638abda73dbc8 Mon Sep 17 00:00:00 2001
From: David Lu <david.lu@hotmail.com>
Date: Mon, 6 Jun 2016 10:54:23 -0700
Subject: PLT-3185 Added support for DMs in Channel Switcher (#3260)

* Added support for DMs

* Checked username beginning characters
---
 webapp/utils/utils.jsx | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'webapp/utils/utils.jsx')

diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx
index fdce93ef0..452ee1f7d 100644
--- a/webapp/utils/utils.jsx
+++ b/webapp/utils/utils.jsx
@@ -1147,6 +1147,13 @@ export function getDirectChannelName(id, otherId) {
     return handle;
 }
 
+export function getDirectChannelNameByUsername(username, otherUsername) {
+    const id = UserStore.getProfileByUsername(username).id;
+    const otherId = UserStore.getProfileByUsername(otherUsername).id;
+
+    return getDirectChannelName(id, otherId);
+}
+
 // Used to get the id of the other user from a DM channel
 export function getUserIdFromChannelName(channel) {
     var ids = channel.name.split('__');
-- 
cgit v1.2.3-1-g7c22

