summaryrefslogtreecommitdiffstats
path: root/web/react/utils/utils.jsx
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-10-20 14:49:42 -0700
committer=Corey Hulen <corey@hulen.com>2015-10-20 14:49:42 -0700
commit1fc12dd8ba2238eba7d154eee55e1381e7415372 (patch)
treedf92c9501d91b29801c87d38e7d0a0ec234bbcee /web/react/utils/utils.jsx
parentfa3a0df2b63d3f1bbbad44bf20afa48fed42aa06 (diff)
downloadchat-1fc12dd8ba2238eba7d154eee55e1381e7415372.tar.gz
chat-1fc12dd8ba2238eba7d154eee55e1381e7415372.tar.bz2
chat-1fc12dd8ba2238eba7d154eee55e1381e7415372.zip
Multi-session login
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r--web/react/utils/utils.jsx10
1 files changed, 9 insertions, 1 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 38ac68d58..f17a55142 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -872,7 +872,7 @@ export function getFileUrl(filename) {
if (url.indexOf('/api/v1/files/get') !== -1) {
url = filename.split('/api/v1/files/get')[1];
}
- url = getWindowLocationOrigin() + '/api/v1/files/get' + url;
+ url = getWindowLocationOrigin() + '/api/v1/files/get' + url + '?' + getSessionIndex();
return url;
}
@@ -883,6 +883,14 @@ export function getFileName(path) {
return split[split.length - 1];
}
+export function getSessionIndex() {
+ if (global.window.mm_session_token_index >= 0) {
+ return 'session_token_index=' + global.window.mm_session_token_index;
+ }
+
+ return '';
+}
+
// Generates a RFC-4122 version 4 compliant globally unique identifier.
export function generateId() {
// implementation taken from http://stackoverflow.com/a/2117523