summaryrefslogtreecommitdiffstats
path: root/webapp/utils/utils.jsx
diff options
context:
space:
mode:
authorDavid Lu <david.lu@hotmail.com>2016-06-06 10:54:23 -0700
committerJoram Wilander <jwawilander@gmail.com>2016-06-06 13:54:23 -0400
commitea99cedb62a308415d9558badaf638abda73dbc8 (patch)
treeadf3836560bc4764fa6ebbfe21b7543d4a1c8dfa /webapp/utils/utils.jsx
parent26ec73d5d215f37bb0446f4721ccfea3c9f56f89 (diff)
downloadchat-ea99cedb62a308415d9558badaf638abda73dbc8.tar.gz
chat-ea99cedb62a308415d9558badaf638abda73dbc8.tar.bz2
chat-ea99cedb62a308415d9558badaf638abda73dbc8.zip
PLT-3185 Added support for DMs in Channel Switcher (#3260)
* Added support for DMs * Checked username beginning characters
Diffstat (limited to 'webapp/utils/utils.jsx')
-rw-r--r--webapp/utils/utils.jsx7
1 files changed, 7 insertions, 0 deletions
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('__');