minimum hashtag streaming

This commit is contained in:
cutls 2020-09-02 12:02:31 +09:00
parent fa440e8d9b
commit f43bd64be2

View File

@ -44,10 +44,10 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
//Integratedなら飛ばす //Integratedなら飛ばす
$('#notice_' + tlid).text( $('#notice_' + tlid).text(
'Integrated TL(' + 'Integrated TL(' +
localStorage.getItem('user_' + acct_id) + localStorage.getItem('user_' + acct_id) +
'@' + '@' +
domain + domain +
')' ')'
) )
$('#notice_icon_' + tlid).text('merge_type') $('#notice_icon_' + tlid).text('merge_type')
mixtl(acct_id, tlid, 'integrated', delc, voice) mixtl(acct_id, tlid, 'integrated', delc, voice)
@ -56,10 +56,10 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
//Local+なら飛ばす //Local+なら飛ばす
$('#notice_' + tlid).text( $('#notice_' + tlid).text(
'Local+ TL(' + 'Local+ TL(' +
localStorage.getItem('user_' + acct_id) + localStorage.getItem('user_' + acct_id) +
'@' + '@' +
domain + domain +
')' ')'
) )
$('#notice_icon_' + tlid).text('people_outline') $('#notice_icon_' + tlid).text('people_outline')
mixtl(acct_id, tlid, 'plus', delc, voice) mixtl(acct_id, tlid, 'plus', delc, voice)
@ -69,11 +69,11 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
notf(acct_id, tlid, 'direct') notf(acct_id, tlid, 'direct')
$('#notice_' + tlid).text( $('#notice_' + tlid).text(
cap(type, data, acct_id) + cap(type, data, acct_id) +
'(' + '(' +
localStorage.getItem('user_' + acct_id) + localStorage.getItem('user_' + acct_id) +
'@' + '@' +
domain + domain +
')' ')'
) )
$('#notice_icon_' + tlid).text('notifications') $('#notice_icon_' + tlid).text('notifications')
return return
@ -82,11 +82,11 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
getBookmark(acct_id, tlid) getBookmark(acct_id, tlid)
$('#notice_' + tlid).text( $('#notice_' + tlid).text(
cap(type, data, acct_id) + cap(type, data, acct_id) +
'(' + '(' +
localStorage.getItem('user_' + acct_id) + localStorage.getItem('user_' + acct_id) +
'@' + '@' +
domain + domain +
')' ')'
) )
$('#notice_icon_' + tlid).text('bookmark') $('#notice_icon_' + tlid).text('bookmark')
return return
@ -95,11 +95,11 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
getUtl(acct_id, tlid, data, false) getUtl(acct_id, tlid, data, false)
$('#notice_' + tlid).text( $('#notice_' + tlid).text(
cap(type, data, acct_id) + cap(type, data, acct_id) +
'(' + '(' +
localStorage.getItem('user_' + acct_id) + localStorage.getItem('user_' + acct_id) +
'@' + '@' +
domain + domain +
')' ')'
) )
$('#notice_icon_' + tlid).text('person') $('#notice_icon_' + tlid).text('person')
return return
@ -117,11 +117,11 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
} }
$('#notice_' + tlid).text( $('#notice_' + tlid).text(
cap(type, data, acct_id) + cap(type, data, acct_id) +
'(' + '(' +
localStorage.getItem('user_' + acct_id) + localStorage.getItem('user_' + acct_id) +
'@' + '@' +
domain + domain +
')' ')'
) )
} else { } else {
var hdr = { var hdr = {
@ -257,15 +257,15 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
var start = wss + '/api/v1/streaming/?stream=user&access_token=' + at var start = wss + '/api/v1/streaming/?stream=user&access_token=' + at
} else if (type == 'pub') { } else if (type == 'pub') {
var add = '' var add = ''
if(remoteOnlyCk(tlid)){ if (remoteOnlyCk(tlid)) {
add = '&remote=true' add = '&remote=true'
} }
var start = wss + '/api/v1/streaming/?stream=public&access_token=' + at + add var start = wss + '/api/v1/streaming/?stream=public&access_token=' + at + add
} else if (type == 'pub-media') { } else if (type == 'pub-media') {
var add = '' var add = ''
if(remoteOnlyCk(tlid)){ if (remoteOnlyCk(tlid)) {
add = '&remote=true' add = '&remote=true'
}var start = } var start =
wss + '/api/v1/streaming/?stream=public:media&access_token=' + at + add wss + '/api/v1/streaming/?stream=public:media&access_token=' + at + add
} else if (type == 'local') { } else if (type == 'local') {
var start = var start =
@ -276,18 +276,19 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
'/api/v1/streaming/?stream=public:local:media&only_media=true&access_token=' + '/api/v1/streaming/?stream=public:local:media&only_media=true&access_token=' +
at at
} else if (type == 'tag') { } else if (type == 'tag') {
if (type == 'tag') { var tag = localStorage.getItem('tag-range')
var tag = localStorage.getItem('tag-range') if (tag == 'local') {
if (tag == 'local') { data = data + '&local=true'
data = data + '&local=true' }
} if(data.name) {
data = data.name
} }
var start = var start =
wss + wss +
'/api/v1/streaming/?stream=hashtag&tag=' + '/api/v1/streaming/?stream=hashtag&tag=' +
data + data +
'&access_token=' + '&access_token=' +
at at + add
} else if (type == 'noauth') { } else if (type == 'noauth') {
var start = 'wss://' + acct_id + '/api/v1/streaming/?stream=public:local' var start = 'wss://' + acct_id + '/api/v1/streaming/?stream=public:local'
} else if (type == 'list') { } else if (type == 'list') {
@ -345,17 +346,17 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
if (delc == 'true') { if (delc == 'true') {
$( $(
'#timeline_' + '#timeline_' +
tlid + tlid +
' [unique-id=' + ' [unique-id=' +
JSON.parse(mess.data).payload + JSON.parse(mess.data).payload +
']' ']'
).addClass('emphasized') ).addClass('emphasized')
$( $(
'#timeline_' + '#timeline_' +
tlid + tlid +
' [unique-id=' + ' [unique-id=' +
JSON.parse(mess.data).payload + JSON.parse(mess.data).payload +
']' ']'
).addClass('by_delcatch') ).addClass('by_delcatch')
} else { } else {
$('[unique-id=' + JSON.parse(mess.data).payload + ']').hide() $('[unique-id=' + JSON.parse(mess.data).payload + ']').hide()
@ -866,13 +867,13 @@ function com(type, data, tlid) {
return 'public?local=true&only_media=true&' return 'public?local=true&only_media=true&'
} else if (type == 'pub') { } else if (type == 'pub') {
var add = '' var add = ''
if(remoteOnlyCk(tlid)){ if (remoteOnlyCk(tlid)) {
add = 'remote=true&' add = 'remote=true&'
} }
return 'public?' + add return 'public?' + add
} else if (type == 'pub-media') { } else if (type == 'pub-media') {
var add = '' var add = ''
if(remoteOnlyCk(tlid)){ if (remoteOnlyCk(tlid)) {
add = 'remote=true&' add = 'remote=true&'
} }
return 'public?only_media=true&' + add return 'public?only_media=true&' + add
@ -1078,10 +1079,10 @@ function getMarker(tlid, type, acct_id) {
$('#unread_' + tlid).attr( $('#unread_' + tlid).attr(
'title', 'title',
lang.lang_layout_unread + lang.lang_layout_unread +
':' + ':' +
json.updated_at + json.updated_at +
' v' + ' v' +
json.version json.version
) )
$('#unread_' + tlid).attr('data-id', json.last_read_id) $('#unread_' + tlid).attr('data-id', json.last_read_id)
} else { } else {
@ -1285,8 +1286,8 @@ function asReadEnd() {
onBeforeOpen: () => { onBeforeOpen: () => {
Swal.showLoading() Swal.showLoading()
}, },
onClose: () => {}, onClose: () => { },
}).then((result) => {}) }).then((result) => { })
} else { } else {
postMessage(['asReadComp', ''], '*') postMessage(['asReadComp', ''], '*')
} }
@ -1349,8 +1350,8 @@ function getUtl(acct_id, tlid, data, more) {
moreloading = true moreloading = true
if (more) { if (more) {
var sid = $('#timeline_' + tlid + ' .cvo') var sid = $('#timeline_' + tlid + ' .cvo')
.last() .last()
.attr('unique-id') .attr('unique-id')
var ad = '?max_id=' + sid var ad = '?max_id=' + sid
} else { } else {
var ad = '' var ad = ''
@ -1426,7 +1427,7 @@ function announ(acct_id, tlid) {
} }
//buildQuery //buildQuery
function buildQuery(name, data) { function buildQuery(name, data) {
if(!data || data == '') return '' if (!data || data == '') return ''
var arr = data.split(',') var arr = data.split(',')
var str = '' var str = ''
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {