From 6faabe34e8a56e247953be631a6af31a132b8b0b Mon Sep 17 00:00:00 2001
From: Andy Lo-A-Foe <andy.loafoe@aemian.com>
Date: Tue, 19 Jan 2016 19:41:39 +0100
Subject: Optionally specify ws:// and wss:// port in config

---
 web/react/utils/utils.jsx | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'web/react/utils/utils.jsx')

diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 24042321f..92ad82739 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -1101,6 +1101,17 @@ export function getFileName(path) {
     return split[split.length - 1];
 }
 
+// Gets the websocket port to use. Configurable on the server.
+export function getWebsocketPort(protocol) {
+	if ((/^wss:/).test(protocol)) { // wss://
+		return ':' + global.window.mm_config.WebsocketSecurePort;
+	}
+	if ((/^ws:/).test(protocol)) {
+		return ':' + global.window.mm_config.WebsocketPort;
+	}
+	return '';
+}
+
 export function getSessionIndex() {
     if (global.window.mm_session_token_index >= 0) {
         return 'session_token_index=' + global.window.mm_session_token_index;
-- 
cgit v1.2.3-1-g7c22


From b870c0117f605364fce627cfa3341f84bebbba17 Mon Sep 17 00:00:00 2001
From: Andy Lo-A-Foe <andy.loafoe@aemian.com>
Date: Wed, 20 Jan 2016 01:03:17 +0100
Subject: Fix indentation

---
 web/react/utils/utils.jsx | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

(limited to 'web/react/utils/utils.jsx')

diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 92ad82739..718095757 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -1103,13 +1103,13 @@ export function getFileName(path) {
 
 // Gets the websocket port to use. Configurable on the server.
 export function getWebsocketPort(protocol) {
-	if ((/^wss:/).test(protocol)) { // wss://
-		return ':' + global.window.mm_config.WebsocketSecurePort;
-	}
-	if ((/^ws:/).test(protocol)) {
-		return ':' + global.window.mm_config.WebsocketPort;
-	}
-	return '';
+    if ((/^wss:/).test(protocol)) { // wss://
+        return ':' + global.window.mm_config.WebsocketSecurePort;
+    }
+    if ((/^ws:/).test(protocol)) {
+        return ':' + global.window.mm_config.WebsocketPort;
+    }
+    return '';
 }
 
 export function getSessionIndex() {
-- 
cgit v1.2.3-1-g7c22

