to streaming notifications with new subscription type streaming

This commit is contained in:
cutls 2020-09-08 23:35:13 +09:00
parent 52a8ec8033
commit 700de676d0

View File

@ -116,7 +116,7 @@ function notfColumn(acct_id, tlid, sys) {
var start = 'wss://' + domain + '/?i=' + at var start = 'wss://' + domain + '/?i=' + at
} }
} }
function notfCommon(acct_id, tlid, sys) { function notfCommon(acct_id, tlid, sys, stream) {
todo('Notifications Loading...') todo('Notifications Loading...')
var native = localStorage.getItem('nativenotf') var native = localStorage.getItem('nativenotf')
var at = localStorage.getItem('acct_' + acct_id + '_at') var at = localStorage.getItem('acct_' + acct_id + '_at')
@ -147,6 +147,10 @@ function notfCommon(acct_id, tlid, sys) {
} }
} }
} }
if(stream == 'only') {
notfWS(misskey, acct_id, tlid, domain, at)
return false
}
fetch(start, i) fetch(start, i)
.then(function(response) { .then(function(response) {
console.log('header to get param:' + response.headers.get('link')) console.log('header to get param:' + response.headers.get('link'))
@ -203,7 +207,7 @@ function notfCommon(acct_id, tlid, sys) {
} }
$('#notf-box').addClass('fetched') $('#notf-box').addClass('fetched')
todc() todc()
notfWS(misskey, acct_id, tlid, domain, at) if(stream != 'no') notfWS(misskey, acct_id, tlid, domain, at)
}) })
} }
function notfWS(misskey, acct_id, tlid, domain, at) { function notfWS(misskey, acct_id, tlid, domain, at) {