@@ -43,7 +43,8 @@ export default Vue.extend({
src: 'home',
list: null,
tagTl: null,
- enableLocalTimeline: false
+ enableLocalTimeline: false,
+ enableGlobalTimeline: false,
};
},
@@ -66,6 +67,7 @@ export default Vue.extend({
created() {
this.$root.getMeta().then(meta => {
this.enableLocalTimeline = !meta.disableLocalTimeline || this.$store.state.i.isModerator || this.$store.state.i.isAdmin;
+ this.enableGlobalTimeline = !meta.disableGlobalTimeline || this.$store.state.i.isModerator || this.$store.state.i.isAdmin;
});
if (this.$store.state.device.tl) {
diff --git a/src/client/app/mobile/views/pages/home.vue b/src/client/app/mobile/views/pages/home.vue
index cc30777177..9adf716b32 100644
--- a/src/client/app/mobile/views/pages/home.vue
+++ b/src/client/app/mobile/views/pages/home.vue
@@ -31,7 +31,7 @@
{{ $t('home') }}
{{ $t('local') }}
{{ $t('hybrid') }}
-
{{ $t('global') }}
+
{{ $t('global') }}
{{ $t('mentions') }}
{{ $t('messages') }}
@@ -79,7 +79,8 @@ export default Vue.extend({
lists: null,
tagTl: null,
showNav: false,
- enableLocalTimeline: false
+ enableLocalTimeline: false,
+ enableGlobalTimeline: false,
};
},
@@ -113,6 +114,7 @@ export default Vue.extend({
created() {
this.$root.getMeta().then(meta => {
this.enableLocalTimeline = !meta.disableLocalTimeline || this.$store.state.i.isModerator || this.$store.state.i.isAdmin;
+ this.enableGlobalTimeline = !meta.disableGlobalTimeline || this.$store.state.i.isModerator || this.$store.state.i.isAdmin;
});
if (this.$store.state.device.tl) {
diff --git a/src/models/meta.ts b/src/models/meta.ts
index daa7964d6f..4d4b00be6e 100644
--- a/src/models/meta.ts
+++ b/src/models/meta.ts
@@ -184,6 +184,7 @@ export type IMeta = {
disableRegistration?: boolean;
disableLocalTimeline?: boolean;
+ disableGlobalTimeline?: boolean;
hidedTags?: string[];
mascotImageUrl?: string;
bannerUrl?: string;
diff --git a/src/server/api/endpoints/admin/update-meta.ts b/src/server/api/endpoints/admin/update-meta.ts
index cf117ebd71..13663243a2 100644
--- a/src/server/api/endpoints/admin/update-meta.ts
+++ b/src/server/api/endpoints/admin/update-meta.ts
@@ -32,6 +32,13 @@ export const meta = {
}
},
+ disableGlobalTimeline: {
+ validator: $.bool.optional.nullable,
+ desc: {
+ 'ja-JP': 'グローバルタイムラインを無効にするか否か'
+ }
+ },
+
hidedTags: {
validator: $.arr($.str).optional.nullable,
desc: {
@@ -331,6 +338,10 @@ export default define(meta, (ps) => new Promise(async (res, rej) => {
set.disableLocalTimeline = ps.disableLocalTimeline;
}
+ if (typeof ps.disableGlobalTimeline === 'boolean') {
+ set.disableGlobalTimeline = ps.disableGlobalTimeline;
+ }
+
if (Array.isArray(ps.hidedTags)) {
set.hidedTags = ps.hidedTags;
}
diff --git a/src/server/api/endpoints/meta.ts b/src/server/api/endpoints/meta.ts
index fa933513b7..3b2a49dbb0 100644
--- a/src/server/api/endpoints/meta.ts
+++ b/src/server/api/endpoints/meta.ts
@@ -59,6 +59,7 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
broadcasts: instance.broadcasts || [],
disableRegistration: instance.disableRegistration,
disableLocalTimeline: instance.disableLocalTimeline,
+ disableGlobalTimeline: instance.disableGlobalTimeline,
driveCapacityPerLocalUserMb: instance.localDriveCapacityMb,
driveCapacityPerRemoteUserMb: instance.remoteDriveCapacityMb,
cacheRemoteFiles: instance.cacheRemoteFiles,
@@ -81,6 +82,7 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
response.features = {
registration: !instance.disableRegistration,
localTimeLine: !instance.disableLocalTimeline,
+ globalTimeLine: !instance.disableGlobalTimeline,
elasticsearch: config.elasticsearch ? true : false,
recaptcha: instance.enableRecaptcha,
objectStorage: config.drive && config.drive.storage === 'minio',
diff --git a/src/server/api/endpoints/notes/global-timeline.ts b/src/server/api/endpoints/notes/global-timeline.ts
index f5fd0d6dd8..f0d052ff98 100644
--- a/src/server/api/endpoints/notes/global-timeline.ts
+++ b/src/server/api/endpoints/notes/global-timeline.ts
@@ -53,9 +53,9 @@ export const meta = {
export default define(meta, (ps, user) => new Promise(async (res, rej) => {
const meta = await fetchMeta();
- if (meta.disableLocalTimeline) {
+ if (meta.disableGlobalTimeline) {
if (user == null || (!user.isAdmin && !user.isModerator)) {
- return rej('local timeline disabled');
+ return rej('global timeline disabled');
}
}
diff --git a/src/server/api/stream/channels/global-timeline.ts b/src/server/api/stream/channels/global-timeline.ts
index 611d5a6aef..b09035daee 100644
--- a/src/server/api/stream/channels/global-timeline.ts
+++ b/src/server/api/stream/channels/global-timeline.ts
@@ -15,7 +15,7 @@ export default class extends Channel {
@autobind
public async init(params: any) {
const meta = await fetchMeta();
- if (meta.disableLocalTimeline) {
+ if (meta.disableGlobalTimeline) {
if (this.user == null || (!this.user.isAdmin && !this.user.isModerator)) return;
}