disableLocalTimeline機能を強化
* ストリームだけではなくAPIも無効に * モデレーターは無効の場合でも見れるように * グローバルタイムラインも無効に(連合数が少ないインスタンスではグローバルタイムラインは実質的にローカルタイムラインと同一なので)
This commit is contained in:
parent
c8e2b22942
commit
c2f6b09969
7 changed files with 38 additions and 18 deletions
|
@ -3,6 +3,7 @@ import Mute from '../../../../models/mute';
|
|||
import { pack } from '../../../../models/note';
|
||||
import shouldMuteThisNote from '../../../../misc/should-mute-this-note';
|
||||
import Channel from '../channel';
|
||||
import fetchMeta from '../../../../misc/fetch-meta';
|
||||
|
||||
export default class extends Channel {
|
||||
public readonly chName = 'localTimeline';
|
||||
|
@ -13,6 +14,11 @@ export default class extends Channel {
|
|||
|
||||
@autobind
|
||||
public async init(params: any) {
|
||||
const meta = await fetchMeta();
|
||||
if (meta.disableLocalTimeline) {
|
||||
if (this.user == null || (!this.user.isAdmin && !this.user.isModerator)) return;
|
||||
}
|
||||
|
||||
// Subscribe events
|
||||
this.subscriber.on('localTimeline', this.onNote);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue