url.streaming_url may return URL begins with https://
This commit is contained in:
parent
bb60f28b63
commit
2e84fc5cdc
|
@ -1563,7 +1563,7 @@ function mastodonBaseStreaming(acct_id) {
|
||||||
const at = localStorage.getItem(`acct_${acct_id}_at`)
|
const at = localStorage.getItem(`acct_${acct_id}_at`)
|
||||||
let wss = 'wss://' + domain
|
let wss = 'wss://' + domain
|
||||||
if (localStorage.getItem('streaming_' + acct_id)) {
|
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}`
|
const start = `${wss}/api/v1/streaming/?access_token=${at}`
|
||||||
mastodonBaseWs[domain] = new WebSocket(start)
|
mastodonBaseWs[domain] = new WebSocket(start)
|
||||||
|
|
|
@ -299,7 +299,7 @@ function oldStreaming(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
|
||||||
const domain = localStorage.getItem(`domain_${acct_id}`)
|
const domain = localStorage.getItem(`domain_${acct_id}`)
|
||||||
var at = localStorage.getItem('acct_' + acct_id + '_at')
|
var at = localStorage.getItem('acct_' + acct_id + '_at')
|
||||||
if (localStorage.getItem('streaming_' + acct_id)) {
|
if (localStorage.getItem('streaming_' + acct_id)) {
|
||||||
var wss = localStorage.getItem('streaming_' + acct_id)
|
var wss = localStorage.getItem('streaming_' + acct_id).replace('https://', 'wss://')
|
||||||
} else {
|
} else {
|
||||||
var wss = 'wss://' + domain
|
var wss = 'wss://' + domain
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user