From 2de05b84aa1a9282c8da27008b35b8e358b744fa Mon Sep 17 00:00:00 2001 From: Cutls Date: Tue, 9 Jul 2019 00:27:18 +0900 Subject: [PATCH] Misskey streaming leak --- app/js/tl/misskeyparse.js | 10 +++++++--- app/js/ui/layout.js | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/js/tl/misskeyparse.js b/app/js/tl/misskeyparse.js index c5c1d94c..e79c7364 100644 --- a/app/js/tl/misskeyparse.js +++ b/app/js/tl/misskeyparse.js @@ -979,7 +979,7 @@ function goGoogle(id) { } var misskeyws = [] var misskeywsstate = [] -function connectMisskey(acct_id) { +function connectMisskey(acct_id, re) { var domain = localStorage.getItem("domain_" + acct_id); var at = localStorage.getItem("acct_" + acct_id + "_at"); var start = "wss://" + domain + @@ -1063,13 +1063,17 @@ function connectMisskey(acct_id) { console.error("Error closing " + tlid); console.error(error); misskeywsstate[wsid] = false - connectMisskey(acct_id) + if(!re){ + connectMisskey(acct_id, true) + } return false; }; misskeyws[wsid].onclose = function () { console.warn("Closing " + tlid); misskeywsstate[wsid] = false - connectMisskey(acct_id) + if(!re){ + connectMisskey(acct_id, true) + } return false; }; diff --git a/app/js/ui/layout.js b/app/js/ui/layout.js index 2acf871a..c5296c69 100644 --- a/app/js/ui/layout.js +++ b/app/js/ui/layout.js @@ -55,7 +55,7 @@ function parseColumn(dontclose) { var domain = localStorage.getItem("domain_" + key); if (localStorage.getItem("mode_" + domain) == "misskey") { localStorage.removeItem("misskey_wss_" + key) - connectMisskey(key) + connectMisskey(key, false) } }); }