From 2e84fc5cdc8a45c2642fa1575f4b6456affd5f9f Mon Sep 17 00:00:00 2001 From: cutls Date: Thu, 1 Apr 2021 17:06:56 +0900 Subject: [PATCH] url.streaming_url may return URL begins with https:// --- app/js/tl/parse.js | 2 +- app/js/tl/tl.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index 45ff8cf6..e6109195 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -1563,7 +1563,7 @@ function mastodonBaseStreaming(acct_id) { const at = localStorage.getItem(`acct_${acct_id}_at`) let wss = 'wss://' + domain if (localStorage.getItem('streaming_' + acct_id)) { - wss = localStorage.getItem('streaming_' + acct_id) + wss = localStorage.getItem('streaming_' + acct_id).replace('https://', 'wss://') } const start = `${wss}/api/v1/streaming/?access_token=${at}` mastodonBaseWs[domain] = new WebSocket(start) diff --git a/app/js/tl/tl.js b/app/js/tl/tl.js index 6d56a72b..4398017e 100644 --- a/app/js/tl/tl.js +++ b/app/js/tl/tl.js @@ -299,7 +299,7 @@ function oldStreaming(type, cc, acct_id, tlid, data, mute, delc, voice, mode) { const domain = localStorage.getItem(`domain_${acct_id}`) var at = localStorage.getItem('acct_' + acct_id + '_at') if (localStorage.getItem('streaming_' + acct_id)) { - var wss = localStorage.getItem('streaming_' + acct_id) + var wss = localStorage.getItem('streaming_' + acct_id).replace('https://', 'wss://') } else { var wss = 'wss://' + domain }