#353 subscription type streaming JSON bug
This commit is contained in:
		| @@ -27,12 +27,12 @@ async function mixtl(acct_id, tlid, type, delc, voice) { | |||||||
| 				mixre(acct_id, tlid, 'mix', mute, voice, '') | 				mixre(acct_id, tlid, 'mix', mute, voice, '') | ||||||
| 				clearInterval(mbws) | 				clearInterval(mbws) | ||||||
| 			} else if(mastodonBaseWsStatus[domain] == 'available') { | 			} else if(mastodonBaseWsStatus[domain] == 'available') { | ||||||
| 				mastodonBaseWs[domain].send(`{"type":"subscribe","stream":"public:local"}`) | 				mastodonBaseWs[domain].send(JSON.stringify({type: 'subscribe', stream: 'public:local'})) | ||||||
| 				clearInterval(mbws) | 				clearInterval(mbws) | ||||||
| 			} | 			} | ||||||
| 		}, 1000) | 		}, 1000) | ||||||
| 	} else if(mastodonBaseWsStatus[domain] == 'available') { | 	} else if(mastodonBaseWsStatus[domain] == 'available') { | ||||||
| 		mastodonBaseWs[domain].send(`{"type":"subscribe","stream":"public:local"}`) | 		mastodonBaseWs[domain].send(JSON.stringify({type: 'subscribe', stream: 'public:local'})) | ||||||
| 	} | 	} | ||||||
| 	 | 	 | ||||||
| 	$(window).scrollTop(0) | 	$(window).scrollTop(0) | ||||||
|   | |||||||
| @@ -1564,7 +1564,7 @@ function mastodonBaseStreaming(acct_id) { | |||||||
| 		setTimeout(function () { | 		setTimeout(function () { | ||||||
| 			mastodonBaseWsStatus[domain] = 'available' | 			mastodonBaseWsStatus[domain] = 'available' | ||||||
| 		}, 3000) | 		}, 3000) | ||||||
| 		mastodonBaseWs[domain].send(`{"type":"subscribe","stream":"user"}`) | 		mastodonBaseWs[domain].send(JSON.stringify({type: 'subscribe', stream: 'user'})) | ||||||
| 		$('.notice_icon_acct_' + acct_id).removeClass('red-text') | 		$('.notice_icon_acct_' + acct_id).removeClass('red-text') | ||||||
| 	} | 	} | ||||||
| 	mastodonBaseWs[domain].onmessage = function (mess) { | 	mastodonBaseWs[domain].onmessage = function (mess) { | ||||||
|   | |||||||
| @@ -278,7 +278,7 @@ function stremaingSubscribe(type, acct_id, data, unsubscribe) { | |||||||
| 	else if (type === 'pub') { stream = 'public' } | 	else if (type === 'pub') { stream = 'public' } | ||||||
| 	else if (type === 'pub-media') { stream = 'public:media' } | 	else if (type === 'pub-media') { stream = 'public:media' } | ||||||
| 	else if (type === 'list') { | 	else if (type === 'list') { | ||||||
| 		mastodonBaseWs[domain].send(`{"type":"${command}","stream":"list","list":"${data}"}`) | 		mastodonBaseWs[domain].send(JSON.stringify({type: command, stream: 'list', list: data})) | ||||||
| 		return true | 		return true | ||||||
| 	} else if (type === 'tag') { | 	} else if (type === 'tag') { | ||||||
| 		let arr = [] | 		let arr = [] | ||||||
| @@ -288,11 +288,11 @@ function stremaingSubscribe(type, acct_id, data, unsubscribe) { | |||||||
| 		if (data.any) arr = arr.concat(data.any.split(',')) | 		if (data.any) arr = arr.concat(data.any.split(',')) | ||||||
| 		if (data.all) arr = arr.concat(data.all.split(',')) | 		if (data.all) arr = arr.concat(data.all.split(',')) | ||||||
| 		for (const tag of arr) { | 		for (const tag of arr) { | ||||||
| 			mastodonBaseWs[domain].send(`{"type":"${command}","stream":"hashtag","tag":"${tag}"}`) | 			mastodonBaseWs[domain].send(JSON.stringify({type: command, stream: 'hashtag', tag: tag})) | ||||||
| 		} | 		} | ||||||
| 		return true | 		return true | ||||||
| 	} | 	} | ||||||
| 	mastodonBaseWs[domain].send(`{"type":"${command}","stream":"${stream}"`) | 	mastodonBaseWs[domain].send(JSON.stringify({type: command, stream: stream})) | ||||||
| } | } | ||||||
| function oldStreaming(type, cc, acct_id, tlid, data, mute, delc, voice, mode) { | function oldStreaming(type, cc, acct_id, tlid, data, mute, delc, voice, mode) { | ||||||
| 	var misskey = false | 	var misskey = false | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	