From 700de676d0eb4c4112681fca9190a0bd1cdd1393 Mon Sep 17 00:00:00 2001 From: cutls Date: Tue, 8 Sep 2020 23:35:13 +0900 Subject: [PATCH] to streaming notifications with new subscription type streaming --- app/js/tl/notification.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/js/tl/notification.js b/app/js/tl/notification.js index f62fcc21..296be1f4 100644 --- a/app/js/tl/notification.js +++ b/app/js/tl/notification.js @@ -116,7 +116,7 @@ function notfColumn(acct_id, tlid, sys) { var start = 'wss://' + domain + '/?i=' + at } } -function notfCommon(acct_id, tlid, sys) { +function notfCommon(acct_id, tlid, sys, stream) { todo('Notifications Loading...') var native = localStorage.getItem('nativenotf') 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) .then(function(response) { console.log('header to get param:' + response.headers.get('link')) @@ -203,7 +207,7 @@ function notfCommon(acct_id, tlid, sys) { } $('#notf-box').addClass('fetched') 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) {